'zf_test', 'username' => 'root', 'password' => '', 'host' => '127.0.0.1', 'port' => '3306' ); $db = Zend_Db::factory('Pdo_Mysql', $config); Zend_Db_Table::setDefaultAdapter($db); } function _setupCache() { global $cache; $cache = Zend_Cache::factory('Core', 'File', array('automatic_serialization' => true)); $cache->clean(); Zend_Db_Table::setDefaultMetadataCache($cache); } function _createTable() { global $db; $db->query('DROP TABLE IF EXISTS products'); $sql = <<query($sql); } function _compareIdCache() { global $db, $cache; $table = new Zend_Db_Table('products'); $table->info(Zend_Db_Table::METADATA); $dbConfig = $db->getConfig(); $idCacheExpected = md5( // port:host/dbname:schema.table (based on availabilty) ':' . $dbConfig['port'] .':' . $dbConfig['host'] . '/' . $dbConfig['dbname'] . ':.products' ); $idCacheActual = md5('/zf_test:.products'); assert($cache->test($idCacheExpected)); assert($cache->test($idCacheActual)); } function _dropTable() { global $db; $db->query('DROP TABLE IF EXISTS products'); }