Test to make sure numRows() calls don't show unrelated errors
authorChad Horohoe <chadh@wikimedia.org>
Mon, 26 Nov 2012 13:34:20 +0000 (08:34 -0500)
committerDemon <chadh@wikimedia.org>
Fri, 22 Mar 2013 13:51:07 +0000 (13:51 +0000)
Bug: 42430
Change-Id: Ie939785c1f75aa99bdf59e013d5ebf65e866289c

tests/phpunit/includes/db/DatabaseTest.php

index 65c80d1..c9f5f5c 100644 (file)
@@ -209,4 +209,10 @@ class DatabaseTest extends MediaWikiTestCase {
                                . ( $this->db->getType() == 'postgres' ? '()' : '' )
                );
        }
+
+       function testUnknownTableCorruptsResults() {
+               $res = $this->db->select( 'page', '*', array( 'page_id' => 1 ) );
+               $this->assertFalse( $this->db->tableExists( 'foobarbaz' ) );
+               $this->assertInternalType( 'int', $res->numRows() );
+       }
 }