From: Chad Horohoe Date: Mon, 26 Nov 2012 13:34:20 +0000 (-0500) Subject: Test to make sure numRows() calls don't show unrelated errors X-Git-Tag: 1.31.0-rc.0~20253^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=1b292fe4653c72e66b41bc1fa1977aa3f5d98969;p=lhc%2Fweb%2Fwiklou.git Test to make sure numRows() calls don't show unrelated errors Bug: 42430 Change-Id: Ie939785c1f75aa99bdf59e013d5ebf65e866289c --- diff --git a/tests/phpunit/includes/db/DatabaseTest.php b/tests/phpunit/includes/db/DatabaseTest.php index 65c80d1df6..c9f5f5cc17 100644 --- a/tests/phpunit/includes/db/DatabaseTest.php +++ b/tests/phpunit/includes/db/DatabaseTest.php @@ -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() ); + } }