docs: Remove odd colons after @todo
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionStorageTest_ContentHandlerUseDB.php
index d0cdfc6..f35a05f 100644 (file)
@@ -6,14 +6,9 @@
  * ^--- important, causes temporary tables to be used instead of the real database
  */
 class RevisionTest_ContentHandlerUseDB extends RevisionStorageTest {
-       var $saveContentHandlerNoDB = null;
 
        function setUp() {
-               global $wgContentHandlerUseDB;
-
-               $this->saveContentHandlerNoDB = $wgContentHandlerUseDB;
-
-               $wgContentHandlerUseDB = false;
+               $this->setMwGlobals( 'wgContentHandlerUseDB', false );
 
                $dbw = wfGetDB( DB_MASTER );
 
@@ -32,27 +27,19 @@ class RevisionTest_ContentHandlerUseDB extends RevisionStorageTest {
                parent::setUp();
        }
 
-       function tearDown() {
-               global $wgContentHandlerUseDB;
-
-               parent::tearDown();
-
-               $wgContentHandlerUseDB = $this->saveContentHandlerNoDB;
-       }
-
        /**
         * @covers Revision::selectFields
         */
        public function testSelectFields() {
                $fields = Revision::selectFields();
 
-               $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields');
-               $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields');
-               $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields');
-               $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields');
+               $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' );
+               $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' );
+               $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' );
+               $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' );
 
-               $this->assertFalse( in_array( 'rev_content_model', $fields ), 'missing rev_content_model in list of fields');
-               $this->assertFalse( in_array( 'rev_content_format', $fields ), 'missing rev_content_format in list of fields');
+               $this->assertFalse( in_array( 'rev_content_model', $fields ), 'missing rev_content_model in list of fields' );
+               $this->assertFalse( in_array( 'rev_content_format', $fields ), 'missing rev_content_format in list of fields' );
        }
 
        /**
@@ -61,7 +48,7 @@ class RevisionTest_ContentHandlerUseDB extends RevisionStorageTest {
        public function testGetContentModel() {
                try {
                        $this->makeRevision( array( 'text' => 'hello hello.',
-                                                   'content_model' => CONTENT_MODEL_JAVASCRIPT ) );
+                               'content_model' => CONTENT_MODEL_JAVASCRIPT ) );
 
                        $this->fail( "Creating JavaScript content on a wikitext page should fail with "
                                . "\$wgContentHandlerUseDB disabled" );
@@ -76,14 +63,14 @@ class RevisionTest_ContentHandlerUseDB extends RevisionStorageTest {
         */
        public function testGetContentFormat() {
                try {
-                       //@todo: change this to test failure on using a non-standard (but supported) format
+                       // @todo change this to test failure on using a non-standard (but supported) format
                        //       for a content model supported in the given location. As of 1.21, there are
                        //       no alternative formats for any of the standard content models that could be
                        //       used for this though.
 
                        $this->makeRevision( array( 'text' => 'hello hello.',
-                                                   'content_model' => CONTENT_MODEL_JAVASCRIPT,
-                                                   'content_format' => 'text/javascript' ) );
+                               'content_model' => CONTENT_MODEL_JAVASCRIPT,
+                               'content_format' => 'text/javascript' ) );
 
                        $this->fail( "Creating JavaScript content on a wikitext page should fail with "
                                . "\$wgContentHandlerUseDB disabled" );
@@ -91,5 +78,4 @@ class RevisionTest_ContentHandlerUseDB extends RevisionStorageTest {
                        $this->assertTrue( true ); // ok
                }
        }
-
 }