From 1b292fe4653c72e66b41bc1fa1977aa3f5d98969 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 26 Nov 2012 08:34:20 -0500 Subject: [PATCH] Test to make sure numRows() calls don't show unrelated errors Bug: 42430 Change-Id: Ie939785c1f75aa99bdf59e013d5ebf65e866289c --- tests/phpunit/includes/db/DatabaseTest.php | 6 ++++++ 1 file changed, 6 insertions(+) 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() ); + } } -- 2.20.1