Index: tests/Zend/Db/Statement/MysqliTest.php =================================================================== --- tests/Zend/Db/Statement/MysqliTest.php (revision 17656) +++ tests/Zend/Db/Statement/MysqliTest.php (working copy) @@ -106,6 +106,22 @@ { $this->markTestIncomplete($this->getDriver() . ' has not implemented getColumnMeta() yet [ZF-1424]'); } + + /** + * Tests ZF-3216, that the statement object throws exceptions that + * contain the numerica MySQL SQLSTATE error code + * @group Zend_Db_Statement_Mysqli + */ + public function testStatementExceptionShouldContainErrorCode() + { + $sql = "SELECT * FROM *"; + try { + $stmt = $this->_db->query($sql); + $this->fail('Expected to catch Zend_Db_Statement_Exception'); + } catch (Zend_Exception $e) { + $this->assertType('int', $e->getCode()); + } + } public function getDriver() {