Merge "shell script fix using shellcheck lint"
[lhc/web/wiklou.git] / tests / phpunit / includes / StatusTest.php
index b0e6d20..3829f90 100644 (file)
@@ -233,7 +233,10 @@ class StatusTest extends MediaWikiLangTestCase {
                $status2->error( $message2 );
 
                $status1->merge( $status2 );
-               $this->assertEquals( 2, count( $status1->getWarningsArray() ) + count( $status1->getErrorsArray() ) );
+               $this->assertEquals(
+                       2,
+                       count( $status1->getWarningsArray() ) + count( $status1->getErrorsArray() )
+               );
        }
 
        /**
@@ -249,7 +252,10 @@ class StatusTest extends MediaWikiLangTestCase {
                $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() );
        }
 
@@ -259,7 +265,10 @@ class StatusTest extends MediaWikiLangTestCase {
        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' ) );
        }
 
@@ -302,8 +311,9 @@ class StatusTest extends MediaWikiLangTestCase {
         * @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() );
@@ -345,7 +355,7 @@ class StatusTest extends MediaWikiLangTestCase {
                $testCases[ '2StringWarnings' ] = array(
                        $status,
                        "* <fooBar!>\n* <fooBar2!>\n",
-                       "<ul>\n<li> &lt;fooBar!&gt;\n</li>\n<li> &lt;fooBar2!&gt;\n</li>\n</ul>\n",
+                       "<ul><li> &lt;fooBar!&gt;</li>\n<li> &lt;fooBar2!&gt;</li></ul>\n",
                );
 
                $status = new Status();
@@ -362,7 +372,7 @@ class StatusTest extends MediaWikiLangTestCase {
                $testCases[ '2MessageWarnings' ] = array(
                        $status,
                        "* <fooBar!>\n* <fooBar2!>\n",
-                       "<ul>\n<li> &lt;fooBar!&gt;\n</li>\n<li> &lt;fooBar2!&gt;\n</li>\n</ul>\n",
+                       "<ul><li> &lt;fooBar!&gt;</li>\n<li> &lt;fooBar2!&gt;</li></ul>\n",
                );
 
                return $testCases;
@@ -541,7 +551,7 @@ class StatusTest extends MediaWikiLangTestCase {
         */
        public function testGetStatusArrayWithNonObjectMessages( $nonObjMsg ) {
                $status = new Status();
-               if( !array_key_exists( 1, $nonObjMsg ) ) {
+               if ( !array_key_exists( 1, $nonObjMsg ) ) {
                        $status->warning( $nonObjMsg[0] );
                } else {
                        $status->warning( $nonObjMsg[0], $nonObjMsg[1] );