Merge "Test to make sure numRows() calls don't show unrelated errors"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 22 Mar 2013 13:58:54 +0000 (13:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 22 Mar 2013 13:58:55 +0000 (13:58 +0000)
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() );
+       }
 }