Merge "Simplify documentation headers of includes/widgets/…Widget.php files"
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionTest.php
index a467346..73d69a5 100644 (file)
@@ -80,6 +80,17 @@ class RevisionTest extends MediaWikiTestCase {
                $this->assertNull( $rev->getContent(), 'no content object should be available' );
        }
 
+       /**
+        * @covers Revision::__construct
+        * @covers \MediaWiki\Storage\RevisionStore::newMutableRevisionFromArray
+        */
+       public function testConstructFromArrayWithBadPageId() {
+               MediaWiki\suppressWarnings();
+               $rev = new Revision( [ 'page' => 77777777 ] );
+               $this->assertSame( 77777777, $rev->getPage() );
+               MediaWiki\restoreWarnings();
+       }
+
        public function provideConstructFromArray_userSetAsExpected() {
                yield 'no user defaults to wgUser' => [
                        [
@@ -301,6 +312,17 @@ class RevisionTest extends MediaWikiTestCase {
                $assertions( $this, $rev );
        }
 
+       /**
+        * @covers Revision::__construct
+        * @covers \MediaWiki\Storage\RevisionStore::newMutableRevisionFromArray
+        */
+       public function testConstructFromRowWithBadPageId() {
+               MediaWiki\suppressWarnings();
+               $rev = new Revision( (object)[ 'rev_page' => 77777777 ] );
+               $this->assertSame( 77777777, $rev->getPage() );
+               MediaWiki\restoreWarnings();
+       }
+
        public function provideGetRevisionText() {
                yield 'Generic test' => [
                        'This is a goat of revision text.',