diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/tests/phpunit/bootstrap.php |
first commit
Diffstat (limited to 'www/wiki/tests/phpunit/bootstrap.php')
-rw-r--r-- | www/wiki/tests/phpunit/bootstrap.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/www/wiki/tests/phpunit/bootstrap.php b/www/wiki/tests/phpunit/bootstrap.php new file mode 100644 index 00000000..a5c8ef61 --- /dev/null +++ b/www/wiki/tests/phpunit/bootstrap.php @@ -0,0 +1,29 @@ +<?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(); |