$status2->error( $message2 );
$status1->merge( $status2 );
- $this->assertEquals( 2, count( $status1->getWarningsArray() ) + count( $status1->getErrorsArray() ) );
+ $this->assertEquals(
+ 2,
+ count( $status1->getWarningsArray() ) + count( $status1->getErrorsArray() )
+ );
}
/**
$status2->value = 'FooValue';
$status1->merge( $status2, true );
- $this->assertEquals( 2, count( $status1->getWarningsArray() ) + count( $status1->getErrorsArray() ) );
+ $this->assertEquals(
+ 2,
+ count( $status1->getWarningsArray() ) + count( $status1->getErrorsArray() )
+ );
$this->assertEquals( 'FooValue', $status1->getValue() );
}
public function testHasMessage() {
$status = new Status();
$status->fatal( 'bad' );
+ $status->fatal( wfMessage( 'bad-msg' ) );
$this->assertTrue( $status->hasMessage( 'bad' ) );
+ $this->assertTrue( $status->hasMessage( 'bad-msg' ) );
+ $this->assertTrue( $status->hasMessage( wfMessage( 'bad-msg' ) ) );
$this->assertFalse( $status->hasMessage( 'good' ) );
}
* @dataProvider provideGetWikiTextAndHtml
* @covers Status::getHtml
* @todo test long and short context messages generated through this method
- * this can not really be done now due to use of $this->getWikiText using wfMessage()->plain()
- * It is possible to mock such methods but only if namespaces are used
+ * this can not really be done now due to use of $this->getWikiText using
+ * wfMessage()->plain(). It is possible to mock such methods but only if
+ * namespaces are used.
*/
public function testGetHtml( Status $status, $wikitext, $html ) {
$this->assertEquals( $html, $status->getHTML() );
$testCases[ '2StringWarnings' ] = array(
$status,
"* <fooBar!>\n* <fooBar2!>\n",
- "<ul>\n<li> <fooBar!>\n</li>\n<li> <fooBar2!>\n</li>\n</ul>\n",
+ "<ul><li> <fooBar!></li>\n<li> <fooBar2!></li></ul>\n",
);
$status = new Status();
$testCases[ '2MessageWarnings' ] = array(
$status,
"* <fooBar!>\n* <fooBar2!>\n",
- "<ul>\n<li> <fooBar!>\n</li>\n<li> <fooBar2!>\n</li>\n</ul>\n",
+ "<ul><li> <fooBar!></li>\n<li> <fooBar2!></li></ul>\n",
);
return $testCases;