diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-04-01 06:11:44 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-04-01 06:11:44 +0200 |
commit | 14f74d141ab5580688bfd46d2f74c026e43ed967 (patch) | |
tree | 081b7cbfc4d246ecc42831978d080331267cf57c /tests/phpunit/bootstrap.php | |
parent | 4a953b6bfda28604979feb9cfbb58974d13b84bb (diff) |
Update to MediaWiki 1.24.2
Diffstat (limited to 'tests/phpunit/bootstrap.php')
-rw-r--r-- | tests/phpunit/bootstrap.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php new file mode 100644 index 00000000..121aade9 --- /dev/null +++ b/tests/phpunit/bootstrap.php @@ -0,0 +1,36 @@ +<?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 __construct() { + wfProfileIn( __CLASS__ ); + } + + public function __destruct() { + wfProfileOut( __CLASS__ ); + + // 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(); |