Explorar o código

Added unit test for issue in quoteInto with $count and question mark in $value

Ivan A. Ponomarev %!s(int64=11) %!d(string=hai) anos
pai
achega
f608be8f71
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      tests/Zend/Db/Adapter/TestCommon.php

+ 10 - 0
tests/Zend/Db/Adapter/TestCommon.php

@@ -1267,6 +1267,16 @@ abstract class Zend_Db_Adapter_TestCommon extends Zend_Db_TestSetup
             'Incorrect quoteInto() result for count');
     }
 
+    public function testAdapterQuoteIntoCountAndQuestionMark()
+    {
+        $string = 'foo = ? OR moo = ? OR boo = ?';
+        $param = 'What?';
+        $value = $this->_db->quoteInto($string, $param, null, 2);
+        $this->assertTrue(is_string($value));
+        $this->assertEquals("foo = 'What?' OR moo = 'What?' OR boo = ?", $value,
+            'Incorrect quoteInto() result for count and question mark in value');
+    }
+
     public function testAdapterQuoteTypeInt()
     {
         foreach ($this->_numericDataTypes as $typeName => $type) {