Merge "API: Restore ability for dieStatus() to be passed a non-fatal Status"
[lhc/web/wiklou.git] / tests / phpunit / bootstrap.php
index 933767e..a5c8ef6 100644 (file)
@@ -11,22 +11,19 @@ if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
 You are running these tests directly from phpunit. You may not have all globals correctly set.
 Running phpunit.php instead is recommended.
 EOF;
-       require_once ( __DIR__ . "/phpunit.php" );
+       require_once __DIR__ . "/phpunit.php";
 }
 
-// Output a notice when running with older versions of PHPUnit
-if ( version_compare( PHPUnit_Runner_Version::id(), "3.6.7", "<" ) ) {
-  echo <<<EOF
-********************************************************************************
+class MediaWikiPHPUnitBootstrap {
+       public function __destruct() {
+               // Return to real wiki db, so profiling data is preserved
+               MediaWikiTestCase::teardownTestDB();
 
-These tests run best with version PHPUnit 3.6.7 or better. Earlier versions may
-show failures because earlier versions of PHPUnit do not properly implement
-dependencies.
+               // Log profiling data, e.g. in the database or UDP
+               wfLogProfilingData();
+       }
 
-********************************************************************************
-
-EOF;
 }
 
-/** @todo Check if this is really needed */
-MessageCache::destroyInstance();
+// This will be destructed after all tests have been run
+$mediawikiPHPUnitBootstrap = new MediaWikiPHPUnitBootstrap();