wiki.techinc.nl/tests/phpunit/bootstrap.php
Chad Horohoe 950368c7e8 Remove phpunit profiling. It doesn't make any sense
Change-Id: I7aa98ddc0a80f931a685e2946e61aa4a7dfdabff
2015-02-10 18:50:52 +00:00

29 lines
748 B
PHP

<?php
/**
* Bootstrapping for MediaWiki PHPUnit tests
* This file is included by phpunit and is NOT in the global scope.
*
* @file
*/
if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
echo <<<EOF
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";
}
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();