Merge "Make sure that SQLite uses no prefix"
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionStorageTest.php
index fbaa34c..4fa42f3 100644 (file)
@@ -268,6 +268,25 @@ class RevisionStorageTest extends MediaWikiTestCase {
                $this->assertEquals( 'hello hello.', $rev->getText() );
        }
 
+       /**
+        * @covers Revision::getContent
+        */
+       public function testGetContent_failure()
+       {
+               $rev = new Revision( array(
+                       'page'       =>  $this->the_page->getId(),
+                       'content_model' => $this->the_page->getContentModel(),
+                       'text_id' => 123456789, // not in the test DB
+               ) );
+
+               $this->assertNull( $rev->getContent(),
+                       "getContent() should return null if the revision's text blob could not be loaded." );
+
+               //NOTE: check this twice, once for lazy initialization, and once with the cached value.
+               $this->assertNull( $rev->getContent(),
+                       "getContent() should return null if the revision's text blob could not be loaded." );
+       }
+
        /**
         * @covers Revision::getContent
         */