User "^demon" posted a comment on MediaWiki.r90137.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90137#c18171
Commit summary:

Fix for partial regression in r84534: Block::newFromId was no longer handling 
the case where there was no matching row correctly. Now returns null.

This bug was showing up in test results like this:

  BlockTest::testInitializerFunctionsReturnCorrectBlock
  Trying to get property of non-object

  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:340
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:365
  /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/Block.php:118
  
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/BlockTest.php:60
  
/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

However, that only triggers because the actual test is failing -- it's 
expecting to get a return back. This can only be reproduce when using the 
suite.xml configuration file, and not when running the BlockTest standalone.

Comment:

That's because Block::insert() is not correct here anyway (it doesn't set 
$this->mId for one, and nextSequenceValue() fails for Mysql, as we've discussed 
before).

You can prove the multiple instantiations--and thus multiple setUp()s--by 
removing the IGNORE from Block::insert() and run the test with --filter. It'll 
explode due to the duplicate block insertions.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to