diff --git a/tests/phpunit/LinkerTest.php b/tests/phpunit/LinkerTest.php index 108e669..b221910 100644 --- a/tests/phpunit/LinkerTest.php +++ b/tests/phpunit/LinkerTest.php @@ -22,7 +22,7 @@ class LinkTitlesLinkerTest extends LinkTitles\TestCase { /** * @dataProvider provideLinkContentSmartModeData */ - public function testLinkContentSmartMode( $capitalLinks, $smartMode, $input, $expectedOutput) { + public function testLinkContentSmartMode( $capitalLinks, $smartMode, $input, $expectedOutput ) { $this->setMwGlobals( 'wgCapitalLinks', $capitalLinks ); $config = new LinkTitles\Config(); $config->firstOnly = false; @@ -130,4 +130,12 @@ class LinkTitlesLinkerTest extends LinkTitles\TestCase { ], ]; } + + public function testLinkContentBlackList() { + $config = new LinkTitles\Config(); + $config->blackList = [ 'Foo', 'Link target', 'Bar' ]; + $linker = new LinkTitles\Linker( $config ); + $text = 'If the link target is blacklisted, it should not be linked'; + $this->assertSame( $text, $linker->linkContent( $this->title, $text ) ); + } }