bootstrap.php 748 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Bootstrapping for MediaWiki PHPUnit tests
  4. * This file is included by phpunit and is NOT in the global scope.
  5. *
  6. * @file
  7. */
  8. if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
  9. echo <<<EOF
  10. You are running these tests directly from phpunit. You may not have all globals correctly set.
  11. Running phpunit.php instead is recommended.
  12. EOF;
  13. require_once __DIR__ . "/phpunit.php";
  14. }
  15. class MediaWikiPHPUnitBootstrap {
  16. public function __destruct() {
  17. // Return to real wiki db, so profiling data is preserved
  18. MediaWikiTestCase::teardownTestDB();
  19. // Log profiling data, e.g. in the database or UDP
  20. wfLogProfilingData();
  21. }
  22. }
  23. // This will be destructed after all tests have been run
  24. $mediawikiPHPUnitBootstrap = new MediaWikiPHPUnitBootstrap();