Merge "Fix global objects and singletons in NewParserTest"
[lhc/web/wiklou.git] / tests / phpunit / maintenance / MaintenanceTest.php
index b9c0fb8..f4b61af 100644 (file)
@@ -81,18 +81,18 @@ class MaintenanceFixup extends Maintenance {
                        return;
                }
 
-               return call_user_func_array ( array( "parent", __FUNCTION__ ), func_get_args() );
+               return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() );
        }
 
        /**
         * Safety net around register_shutdown_function of Maintenance.php
         */
        public function __destruct() {
-               if ( ! $this->shutdownSimulated ) {
+               if ( !$this->shutdownSimulated ) {
                        // Someone generated a MaintenanceFixup instance without calling
                        // simulateShutdown. We'd have to raise a PHPUnit exception to correctly
                        // flag this illegal usage. However, we are already in a destruktor, which
-                       // would trigger undefined behaviour. Hence, we can only report to the
+                       // would trigger undefined behavior. Hence, we can only report to the
                        // error output :( Hopefully people read the PHPUnit output.
                        $name = $this->testCase->getName();
                        fwrite( STDERR, "ERROR! Instance of " . __CLASS__ . " for test $name "
@@ -112,7 +112,6 @@ class MaintenanceFixup extends Maintenance {
        }
 
 
-
        // --- Making protected functions visible for test
 
        public function output( $out, $channel = null ) {
@@ -120,17 +119,15 @@ class MaintenanceFixup extends Maintenance {
                // Maintenance::output signature. However, we do not use (or rely on)
                // those variables. Instead we pass to Maintenance::output whatever we
                // receive at runtime.
-               return call_user_func_array ( array( "parent", __FUNCTION__ ), func_get_args() );
+               return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() );
        }
 
 
-
        // --- Requirements for getting instance of abstract class
 
        public function execute() {
                $this->testCase->fail( __METHOD__ . " called unexpectedly" );
        }
-
 }
 
 class MaintenanceTest extends MediaWikiTestCase {
@@ -173,7 +170,7 @@ class MaintenanceTest extends MediaWikiTestCase {
        private function assertOutputPrePostShutdown( $preShutdownOutput, $expectNLAppending ) {
 
                $this->assertEquals( $preShutdownOutput, $this->getActualOutput(),
-                               "Output before shutdown simulation" );
+                       "Output before shutdown simulation" );
 
                $this->m->simulateShutdown();
                $this->m = null;
@@ -186,8 +183,7 @@ class MaintenanceTest extends MediaWikiTestCase {
        // Although the following tests do not seem to be too consistent (compare for
        // example the newlines within the test.*StringString tests, or the
        // test.*Intermittent.* tests), the objective of these tests is not to describe
-       // consistent behaviour, but rather currently existing behaviour.
-
+       // consistent behavior, but rather currently existing behavior.
 
        function testOutputEmpty() {
                $this->m->output( "" );
@@ -710,7 +706,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->output( "bar" );
 
                $this->assertEquals( "foobar", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foobar", false );
        }
@@ -722,7 +718,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->output( "bar", null );
 
                $this->assertEquals( "foobar", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foobar", false );
        }
@@ -734,7 +730,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->output( "bar", "bazChannel" );
 
                $this->assertEquals( "foobar", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foobar\n", true );
        }
@@ -746,7 +742,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->output( "bar\n", null );
 
                $this->assertEquals( "foo\nbar\n", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foo\nbar\n", false );
        }
@@ -758,7 +754,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->output( "bar\n", "bazChannel" );
 
                $this->assertEquals( "foobar", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foobar\n", true );
        }
@@ -770,7 +766,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->outputChanneled( "bar" );
 
                $this->assertEquals( "foo\nbar\n", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foo\nbar\n", false );
        }
@@ -782,7 +778,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->outputChanneled( "bar", null );
 
                $this->assertEquals( "foo\nbar\n", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foo\nbar\n", false );
        }
@@ -794,7 +790,7 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->outputChanneled( "bar", "bazChannel" );
 
                $this->assertEquals( "foobar", $this->getActualOutput(),
-                               "Output before shutdown simulation (m2)" );
+                       "Output before shutdown simulation (m2)" );
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foobar\n", true );
        }
@@ -806,17 +802,15 @@ class MaintenanceTest extends MediaWikiTestCase {
                $m2->outputChanneled( "bar", "bazChannel" );
 
                $this->assertEquals( "foobar", $this->getActualOutput(),
-                               "Output before first cleanup" );
+                       "Output before first cleanup" );
                $this->m->cleanupChanneled();
                $this->assertEquals( "foobar\n", $this->getActualOutput(),
-                               "Output after first cleanup" );
+                       "Output after first cleanup" );
                $m2->cleanupChanneled();
                $this->assertEquals( "foobar\n\n", $this->getActualOutput(),
-                               "Output after second cleanup" );
+                       "Output after second cleanup" );
 
                $m2->simulateShutdown();
                $this->assertOutputPrePostShutdown( "foobar\n\n", false );
        }
-
-
 }