User "Catrope" changed the status of MediaWiki.r94350. Old Status: new New Status: fixme
User "Catrope" also posted a comment on MediaWiki.r94350. Full URL: https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/94350#c20709 Commit summary: Fix r91886 thanks to johnduhart: check if it is an IP *before* stripping subpages, otherwise IP range blocking does not work Comment: Causes a test failure: <pre> Error: BlockTest::testInitializerFunctionsReturnCorrectBlock Argument 1 passed to Block::equals() must be an instance of Block, null given, called in /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/BlockTest.php on line 68 and defined /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:136 /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/BlockTest.php:68 /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60 /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20 /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60 </pre> The backtrace is a bit of a red herring. The unit test triggering the error is this: <pre> /** * CheckUser since being changed to use Block::newFromTarget started failing * because the new function didn't accept empty strings like Block::load() * had. Regression bug 29116. * * @dataProvider dataBug29116 */ function testBug29116NewFromTargetWithEmptyIp( $vagueTarget ) { $block = Block::newFromTarget('UTBlockee', $vagueTarget); $this->assertTrue( $this->block->equals( $block ), "newFromTarget() returns the same block as the one that was made when given empty vagueTarget param " . var_export( $vagueTarget, true ) ); } </pre> So what happens is that <code>newFromTarget()</code> returns null (which is the real issue), and <code>equals()</code> barfs on it (which is what causes the error). _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
