adapterMock = $this->getMock('Zend_Test_DbAdapter'); } /** * @return Zend_Test_PHPUnit_Db_Connection */ public function createConnection() { $connection = new Zend_Test_PHPUnit_Db_Connection($this->adapterMock, "schema"); return $connection; } public function testCloseConnection() { $this->adapterMock->expects($this->once()) ->method('closeConnection'); $connection = $this->createConnection(); $connection->close(); } public function testCreateQueryTable() { $connection = $this->createConnection(); $ret = $connection->createQueryTable("foo", "foo"); $this->assertType('Zend_Test_PHPUnit_Db_DataSet_QueryTable', $ret); } public function testGetSchema() { $fixtureSchema = "schema"; $connection = new Zend_Test_PHPUnit_Db_Connection($this->adapterMock, $fixtureSchema); $this->assertEquals($fixtureSchema, $connection->getSchema()); } public function testGetMetaData() { $connection = $this->createConnection(); $metadata = $connection->getMetaData(); $this->assertType('Zend_Test_PHPUnit_Db_Metadata_Generic', $metadata); } public function testGetTruncateCommand() { $connection = $this->createConnection(); $this->assertEquals("DELETE", $connection->getTruncateCommand()); } }