X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FLinkerTest.php;h=fe325075d56d3b6563018dca4b2c1352d2a96a96;hb=204d0df4d2bb8139109253f3da1df42cd455850c;hp=c700d5fead6ccc5c45314ac7fd9d7447704a81ce;hpb=b13123c3ac2969eeb849e7302ba51a6108be8e31;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php index c700d5fead..fe325075d5 100644 --- a/tests/phpunit/includes/LinkerTest.php +++ b/tests/phpunit/includes/LinkerTest.php @@ -14,11 +14,11 @@ class LinkerTest extends MediaWikiLangTestCase { ] ); // We'd also test the warning, but injecting a mock logger into a static method is tricky. - if ( $userName === '' ) { + if ( !$userName ) { Wikimedia\suppressWarnings(); } $actual = Linker::userLink( $userId, $userName, $altUserName ); - if ( $userName === '' ) { + if ( !$userName ) { Wikimedia\restoreWarnings(); } @@ -37,6 +37,9 @@ class LinkerTest extends MediaWikiLangTestCase { 'Empty username, userid 0' => [ '(no username available)', 0, '' ], 'Empty username, userid > 0' => [ '(no username available)', 73, '' ], + 'false instead of username' => [ '(no username available)', 73, false ], + 'null instead of username' => [ '(no username available)', 0, null ], + # ## ANONYMOUS USER ######################################## [ '