MediaWiki REL1_33
bootstrap.php
Go to the documentation of this file.
1<?php
9if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
10 echo <<<EOF
11You are running these tests directly from phpunit. You may not have all globals correctly set.
12Running phpunit.php instead is recommended.
13EOF;
14 require_once __DIR__ . "/phpunit.php";
15}
16
17// The PHPUnit_TextUI_TestRunner class will run each test suite and may call
18// exit() with an exit status code. As such, we cannot run code "after the last test"
19// by adding statements to PHPUnitMaintClass::execute or MediaWikiPHPUnitCommand::run.
20// Instead, we work around it by registering a shutdown callback from the bootstrap
21// file, which runs before PHPUnit starts.
22// @todo Once we use PHPUnit 8 or higher, use the 'AfterLastTestHook' feature.
23// https://phpunit.readthedocs.io/en/8.0/extending-phpunit.html#available-hook-interfaces
24register_shutdown_function( function () {
25 // This will:
26 // - clear the temporary job queue.
27 // - allow extensions to delete any temporary tables they created.
28 // - restore ability to connect to the real database,
29 // (for logging profiling data).
31
32 // Log profiling data, e.g. in the database or UDP
34} );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfLogProfilingData()
static teardownTestDB()
Restores MediaWiki to using the table set (table prefix) it was using before setupTestDB() was called...
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining globals
Definition globals.txt:39