_connection = $db; $this->_schema = $schema; } /** * Close this connection. * * @return void */ public function close() { $this->_connection->closeConnection(); } /** * Creates a table with the result of the specified SQL statement. * * @param string $resultName * @param string $sql * @return PHPUnit_Extensions_Database_DataSet_ITable */ public function createQueryTable($resultName, $sql) { return new Zend_Test_PHPUnit_Db_DataSet_QueryTable($resultName, $sql, $this); } /** * Returns a Zend_Db Connection * * @return Zend_Db_Adapter_Abstract */ public function getConnection() { return $this->_connection; } /** * Returns a database metadata object that can be used to retrieve table * meta data from the database. * * @return PHPUnit_Extensions_Database_DB_IMetaData */ public function getMetaData() { if($this->_metaData === null) { $this->_metaData = new Zend_Test_PHPUnit_Db_Metadata_Generic($this->getConnection(), $this->getSchema()); } return $this->_metaData; } /** * Returns the schema for the connection. * * @return string */ public function getSchema() { return $this->_schema; } /** * Returns the command used to truncate a table. * * @return string */ public function getTruncateCommand() { return "DELETE"; } }