diff --git a/tests/phpunit/LinkerTest.php b/tests/phpunit/LinkerTest.php index b98fc04..31ce2ca 100644 --- a/tests/phpunit/LinkerTest.php +++ b/tests/phpunit/LinkerTest.php @@ -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 link target'; + $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 */