Merge "API: Restore ability for dieStatus() to be passed a non-fatal Status"
[lhc/web/wiklou.git] / tests / phpunit / bootstrap.php
index ea8387c..a5c8ef6 100644 (file)
@@ -11,5 +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";
 }
+
+class MediaWikiPHPUnitBootstrap {
+       public function __destruct() {
+               // Return to real wiki db, so profiling data is preserved
+               MediaWikiTestCase::teardownTestDB();
+
+               // Log profiling data, e.g. in the database or UDP
+               wfLogProfilingData();
+       }
+
+}
+
+// This will be destructed after all tests have been run
+$mediawikiPHPUnitBootstrap = new MediaWikiPHPUnitBootstrap();