Add test case for issue #39.

This commit is contained in:
Daniel Kraus
2018-11-15 20:26:40 +01:00
parent 73f546a33d
commit f44a85b1a0

View File

@ -85,6 +85,21 @@ class LinkTitlesLinkerTest extends LinkTitles\TestCase {
]; ];
} }
/**
* Test issue #39, https://github.com/bovender/LinkTitles/issues/39
*/
public function testNoautolinks() {
$config = new LinkTitles\Config();
$config->firstOnly = false;
LinkTitles\Splitter::invalidate();
$input = 'This is a text with <noautolinks><nowiki>link target</nowiki></noautolinks>';
$source = LinkTitles\Source::createFromTitleAndText( $this->title, $input, $config );
$linker = new LinkTitles\Linker( $config );
$result = $linker->linkContent( $source );
if ( !$result ) { $result = $input; }
$this->assertSame( $input, $result );
}
/** /**
* @dataProvider provideLinkContentTemplatesData * @dataProvider provideLinkContentTemplatesData
*/ */