|
@@ -217,4 +217,34 @@ class Zend_Db_Adapter_Pdo_SqliteTest extends Zend_Db_Adapter_Pdo_TestCommon
|
|
|
$row = $db->fetchRow($select);
|
|
$row = $db->fetchRow($select);
|
|
|
$this->assertTrue($row instanceof stdClass);
|
|
$this->assertTrue($row instanceof stdClass);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ protected function _testAdapterAlternateStatement($stmtClass)
|
|
|
|
|
+ {
|
|
|
|
|
+ $ip = get_include_path();
|
|
|
|
|
+ $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files';
|
|
|
|
|
+ $newIp = $dir . PATH_SEPARATOR . $ip;
|
|
|
|
|
+ set_include_path($newIp);
|
|
|
|
|
+
|
|
|
|
|
+ $params = $this->_util->getParams();
|
|
|
|
|
+
|
|
|
|
|
+ $params['options'] = array(
|
|
|
|
|
+ Zend_Db::AUTO_QUOTE_IDENTIFIERS => false
|
|
|
|
|
+ );
|
|
|
|
|
+ $db = Zend_Db::factory($this->getDriver(), $params);
|
|
|
|
|
+ $db->getConnection();
|
|
|
|
|
+ $db->setStatementClass($stmtClass);
|
|
|
|
|
+
|
|
|
|
|
+ $currentStmtClass = $db->getStatementClass();
|
|
|
|
|
+ $this->assertEquals($stmtClass, $currentStmtClass);
|
|
|
|
|
+
|
|
|
|
|
+ //extra fix for SQLite
|
|
|
|
|
+ $db->query('CREATE TABLE zfbugs (id)');
|
|
|
|
|
+
|
|
|
|
|
+ $bugs = $this->_db->quoteIdentifier('zfbugs');
|
|
|
|
|
+
|
|
|
|
|
+ $stmt = $db->prepare("SELECT COUNT(*) FROM $bugs");
|
|
|
|
|
+
|
|
|
|
|
+ $this->assertTrue($stmt instanceof $stmtClass,
|
|
|
|
|
+ 'Expecting object of type ' . $stmtClass . ', got ' . get_class($stmt));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|