X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=inline;f=tests%2Fphpunit%2Fincludes%2FLinkerTest.php;h=dcac47146ce52c0f819eecd022bf5c93113544b2;hb=9c7f6734c397a954b8eaa5ec73876f2b4bf92afb;hp=c700d5fead6ccc5c45314ac7fd9d7447704a81ce;hpb=742c4988b9c10af39909dceaec3997dcc8745b48;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php index c700d5fead..dcac47146c 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 ######################################## [ 'getUser(); $user->setOption( 'showrollbackconfirmation', $rollbackEnabled ); - $this->assertEquals( 0, Title::newFromText( $title )->getArticleID() ); + $this->assertSame( 0, Title::newFromText( $title )->getArticleID() ); $pageData = $this->insertPage( $title ); $page = WikiPage::factory( $pageData['title'] );