|
|
@@ -98,4 +98,27 @@ abstract class Zend_Db_Statement_Pdo_TestCommon extends Zend_Db_Statement_TestCo
|
|
|
$this->assertType('PDOException', $e->getChainedException());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @group ZF-5868
|
|
|
+ */
|
|
|
+ public function testStatementWillPersistBindParamsInQueryProfilerAfterExecute()
|
|
|
+ {
|
|
|
+ $this->_db->getProfiler()->setEnabled(true);
|
|
|
+ $products = $this->_db->quoteIdentifier('zfproducts');
|
|
|
+ $product_id = $this->_db->quoteIdentifier('product_id');
|
|
|
+
|
|
|
+ $sql = "SELECT * FROM $products WHERE $product_id > :product_id ORDER BY $product_id ASC";
|
|
|
+ $stmt = $this->_db->prepare($sql);
|
|
|
+ $stmt->bindValue('product_id', 1);
|
|
|
+ $stmt->execute();
|
|
|
+
|
|
|
+ $params = $this->_db->getProfiler()->getLastQueryProfile()->getQueryParams();
|
|
|
+
|
|
|
+ $target = array(':product_id' => 1);
|
|
|
+ $this->assertEquals($target, $params);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|