X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fbootstrap.php;h=a5c8ef61c43f95be8c820a5062ffaedb99ee67a4;hb=80f6b8c048ffcfbd97182d7e26b0df107677f36c;hp=ea8387c52f09ba9414145279768af23b7daffc77;hpb=ec0cfb13c053eedf9b5b18074b3a9bf4c8d1b307;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index ea8387c52f..a5c8ef61c4 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -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();