From cdf2980b4e218cb0be615ae41900e92f35f94da0 Mon Sep 17 00:00:00 2001 From: adamgsoc2013 Date: Fri, 2 Aug 2013 00:09:54 +0800 Subject: [PATCH] test case for DBIDrizzle --- test/classes/dbi/DBIDrizzle_test.php | 165 +++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 test/classes/dbi/DBIDrizzle_test.php diff --git a/test/classes/dbi/DBIDrizzle_test.php b/test/classes/dbi/DBIDrizzle_test.php new file mode 100644 index 000000000000..40ba9d438f83 --- /dev/null +++ b/test/classes/dbi/DBIDrizzle_test.php @@ -0,0 +1,165 @@ +object = new PMA_DBI_Drizzle(); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + * + * @access protected + * @return void + */ + protected function tearDown() + { + unset($this->object); + } + + /** + * Test for realMultiQuery + * + * @return void + * + * @group medium + */ + public function testRealMultiQuery() + { + //does not support multi_queries + $this->assertEquals( + false, + $this->object->realMultiQuery(null, "select * from PMA") + ); + } + + /** + * Test for selectDb + * + * @return void + * + * @group medium + */ + public function testrSelectDb() + { + //$link is empty + $GLOBALS['userlink'] = null; + $this->assertEquals( + false, + $this->object->selectDb("PMA") + ); + } + + /** + * Test for moreResults + * + * @return void + * + * @group medium + */ + public function testrMoreResults() + { + //PHP's 'mysql' extension does not support multi_queries + $this->assertEquals( + false, + $this->object->moreResults() + ); + //PHP's 'mysql' extension does not support multi_queries + $this->assertEquals( + false, + $this->object->nextResult() + ); + } + + /** + * Test for getClientInfo + * + * @return void + * + * @group medium + */ + public function testrGetClientInfo() + { + $drizzle_info = 'libdrizzle (Drizzle ' . drizzle_version() . ')'; + $this->assertEquals( + $drizzle_info, + $this->object->getClientInfo() + ); + } + + /** + * Test for numRows + * + * @return void + * + * @group medium + */ + public function testrNumRows() + { + $this->assertEquals( + false, + $this->object->numRows(true) + ); + } + + /** + * Test for storeResult + * + * @return void + * + * @group medium + */ + public function testrStoreResult() + { + $this->assertEquals( + false, + $this->object->storeResult() + ); + } +}