* @since 1.18
*/
abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
-
/**
* $called tracks whether the setUp and tearDown method has been called.
* class extending MediaWikiTestCase usually override setUp and tearDown
$GLOBALS[$key] = $value;
}
$this->mwGlobals = array();
+ RequestContext::resetMain();
$phpErrorLevel = intval( ini_get( 'error_reporting' ) );
$oldHex = strtoupper( dechex( $this->phpErrorLevel ) );
$newHex = strtoupper( dechex( $phpErrorLevel ) );
- $message = "PHP error_reporting setting was left dirty: was 0x$oldHex before test, 0x$newHex after test!";
+ $message = "PHP error_reporting setting was left dirty: "
+ . "was 0x$oldHex before test, 0x$newHex after test!";
$this->fail( $message );
}
//Make 1 page with 1 revision
$page = WikiPage::factory( Title::newFromText( 'UTPage' ) );
- if ( !$page->getId() == 0 ) {
+ if ( $page->getId() == 0 ) {
$page->doEditContent(
new WikitextContent( 'UTContent' ),
'UTPageSummary',
* @param bool $ordered If the order of the values should match
* @param bool $named If the keys should match
*/
- protected function assertArrayEquals( array $expected, array $actual, $ordered = false, $named = false ) {
+ protected function assertArrayEquals( array $expected, array $actual,
+ $ordered = false, $named = false
+ ) {
if ( !$ordered ) {
$this->objectAssociativeSort( $expected );
$this->objectAssociativeSort( $actual );
$this->assertEmpty( $errors, implode( "\n", $errors ) );
}
-
}