r75224 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75223‎ | r75224 | r75225 >
Date:03:01, 23 October 2010
Author:mah
Status:deferred (Comments)
Tags:
Comment:
re r70916: avoid resetting $wgMemc which leads to failures for me
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/TitlePermissionTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/TitlePermissionTest.php
@@ -12,7 +12,9 @@
1313 function setUp() {
1414 global $wgLocaltimezone, $wgLocalTZoffset, $wgMemc, $wgContLang, $wgLang, $wgMessageCache;
1515
16 - $wgMemc = new FakeMemCachedClient;
 16+ if(!$wgMemc) {
 17+ $wgMemc = new FakeMemCachedClient;
 18+ }
1719 $wgMessageCache = new MessageCache( $wgMemc, true, 3600 );
1820 $wgContLang = $wgLang = Language::factory( 'en' );
1921
@@ -45,8 +47,8 @@
4648 }
4749
4850 function tearDown() {
49 - global $wgMemc, $wgContLang, $wgLang;
50 - $wgMemc = $wgContLang = $wgLang = null;
 51+ global $wgContLang, $wgLang;
 52+ $wgContLang = $wgLang = null;
5153 }
5254
5355 function setUserPerm( $perm ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70916Made tests more independent. Some items were only working before previous one...platonides21:22, 11 August 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   03:06, 23 October 2010

Following is what happens when I do:

 $ php phpunit.php --verbose --configuration suite.xml


  ResourceLoaderFileModuleTest
  .
 
  LicensesTest
  .
 
  TitlePermissionTest
  ........
 
  MessageTest
  PHP Fatal error:  Call to a member function get() on a non-object in /home/mah/work/code/mediawiki/mw-svn/includes/MessageCache.php on line 272
PHP Stack trace:
PHP   1. {main}() /home/mah/work/code/mediawiki/mw-svn/maintenance/tests/phpunit/phpunit.php:0
PHP   2. PHPUnit_TextUI_Command::main() /home/mah/work/code/mediawiki/mw-svn/maintenance/tests/phpunit/phpunit.php:34
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:146
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:213
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:688
PHP   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:688
PHP   8. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:729
PHP   9. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:753
PHP  10. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:666
PHP  11. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHPUnit/Framework/TestResult.php:686
PHP  12. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:719
PHP  13. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:836
PHP  14. MessageTest->testExists() /home/mah/work/code/mediawiki/mw-svn/maintenance/tests/phpunit/includes/MessageTest.php:0
PHP  15. Message->exists() /home/mah/work/code/mediawiki/mw-svn/maintenance/tests/phpunit/includes/MessageTest.php:15
PHP  16. Message->fetchMessage() /home/mah/work/code/mediawiki/mw-svn/includes/Message.php:286
PHP  17. MessageCache->get() /home/mah/work/code/mediawiki/mw-svn/includes/Message.php:355
PHP  18. MessageCache->getMsgFromNamespace() /home/mah/work/code/mediawiki/mw-svn/includes/MessageCache.php:578
PHP  19. MessageCache->load() /home/mah/work/code/mediawiki/mw-svn/includes/MessageCache.php:639
#Comment by MarkAHershberger (talk | contribs)   03:30, 23 October 2010

meant to say... that's what happens when I do it without this patch.

Status & tagging log