* Clears $wgUser, and reports errors from addDBData to PHPUnit
*/
protected function setUp() {
- global $wgUser;
-
parent::setUp();
// Check if any Exception is stored for rethrowing from addDBData
throw $this->exceptionFromAddDBData;
}
- $wgUser = new User();
+ $this->setMwGlobals( 'wgUser', new User() );
}
/**
protected function skipToNodeEnd( $name ) {
while ( $this->xml->read() ) {
if ( $this->xml->nodeType == XMLReader::END_ELEMENT &&
- $this->xml->name == $name ) {
+ $this->xml->name == $name
+ ) {
return true;
}
}
+
return false;
}
return true;
}
}
+
return false;
}
protected function skipWhitespace() {
$cont = true;
while ( $cont && ( ( $this->xml->nodeType == XMLReader::WHITESPACE )
- || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) {
+ || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) {
$cont = $this->xml->read();
}
}
$this->assertTextNode( "title", $name );
$this->assertTextNode( "ns", $ns );
$this->assertTextNode( "id", $id );
-
}
/**
* @param $parentid int|false: (optional) id of the parent revision
*/
protected function assertRevision( $id, $summary, $text_id, $text_bytes, $text_sha1, $text = false, $parentid = false,
- $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT ) {
-
+ $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT
+ ) {
$this->assertNodeStart( "revision" );
$this->skipWhitespace();
$this->assertFalse( $this->xml->hasValue, "Revision has text" );
$this->assertTrue( $this->xml->read(), "Skipping text start tag" );
if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT )
- && ( $this->xml->name == "text" ) ) {
+ && ( $this->xml->name == "text" )
+ ) {
$this->xml->read();
}