X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FLinkerTest.php;h=4c508e3851fd5e9daa95834468e3794cbe0e103b;hb=84fa176c9c14cca4dee674c284deb6e6796d928a;hp=7f422541026f883c24405f4b19c333b1a2826a12;hpb=8a95833baed3b8071fcbd8cd2bc8c3449409f665;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php index 7f42254102..4c508e3851 100644 --- a/tests/phpunit/includes/LinkerTest.php +++ b/tests/phpunit/includes/LinkerTest.php @@ -1,11 +1,9 @@ hideDeprecated( 'LinkBegin hook (used in hook-LinkBegin-closure)' ); $this->setMwGlobals( [ 'wgArticlePath' => '/wiki/$1', 'wgServer' => '//example.org', @@ -418,6 +417,7 @@ class LinkerTest extends MediaWikiLangTestCase { * @dataProvider provideLinkEndHook */ public function testLinkEndHook( $callback, $expected ) { + $this->hideDeprecated( 'LinkEnd hook (used in hook-LinkEnd-closure)' ); $this->setMwGlobals( [ 'wgArticlePath' => '/wiki/$1', ] ); @@ -428,54 +428,4 @@ class LinkerTest extends MediaWikiLangTestCase { $out = Linker::link( $title ); $this->assertEquals( $expected, $out ); } - - /** - * @covers Linker::getLinkColour - */ - public function testGetLinkColour() { - $this->hideDeprecated( 'Linker::getLinkColour' ); - $linkCache = MediaWikiServices::getInstance()->getLinkCache(); - $foobarTitle = Title::makeTitle( NS_MAIN, 'FooBar' ); - $redirectTitle = Title::makeTitle( NS_MAIN, 'Redirect' ); - $userTitle = Title::makeTitle( NS_USER, 'Someuser' ); - $linkCache->addGoodLinkObj( - 1, // id - $foobarTitle, - 10, // len - 0 // redir - ); - $linkCache->addGoodLinkObj( - 2, // id - $redirectTitle, - 10, // len - 1 // redir - ); - - $linkCache->addGoodLinkObj( - 3, // id - $userTitle, - 10, // len - 0 // redir - ); - - $this->assertEquals( - '', - Linker::getLinkColour( $foobarTitle, 0 ) - ); - - $this->assertEquals( - 'stub', - Linker::getLinkColour( $foobarTitle, 20 ) - ); - - $this->assertEquals( - 'mw-redirect', - Linker::getLinkColour( $redirectTitle, 0 ) - ); - - $this->assertEquals( - '', - Linker::getLinkColour( $userTitle, 20 ) - ); - } }