Sfoglia il codice sorgente

ZF-2017: fixed test errors when running Zend_Db_AllTests

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16995 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 16 anni fa
parent
commit
ed4d6079b2

+ 10 - 1
tests/Zend/Db/Select/Db2Test.php

@@ -43,7 +43,16 @@ class Zend_Db_Select_Db2Test extends Zend_Db_Select_TestCommon
                             ->where($product_name . ' = ?', "as'as:x");
         return $select;
     }
-    
+
+    /**
+     * ZF-2017: Test bind use of the Zend_Db_Select class.
+     * @group ZF-2017
+     */
+    public function testSelectQueryWithBinds()
+    {
+        $this->markTestSkipped($this->getDriver() . ' does not support named parameters');
+    }
+
     public function getDriver()
     {
         return 'Db2';

+ 8 - 0
tests/Zend/Db/Select/MysqliTest.php

@@ -31,4 +31,12 @@ class Zend_Db_Select_MysqliTest extends Zend_Db_Select_TestCommon
         return 'Mysqli';
     }
 
+    /**
+     * ZF-2017: Test bind use of the Zend_Db_Select class.
+     * @group ZF-2017
+     */
+    public function testSelectQueryWithBinds()
+    {
+        $this->markTestSkipped($this->getDriver() . ' does not support named parameters');
+    }
 }

+ 4 - 1
tests/Zend/Db/Select/TestCommon.php

@@ -87,10 +87,13 @@ abstract class Zend_Db_Select_TestCommon extends Zend_Db_TestSetup
 
     /**
      * ZF-2017: Test bind use of the Zend_Db_Select class.
+     * @group ZF-2017
      */
     public function testSelectQueryWithBinds()
     {
-        $select = $this->_select()->where('product_id = :product_id')
+        $product_id = $this->_db->quoteIdentifier('product_id');
+
+        $select = $this->_select()->where("$product_id = :product_id")
                                   ->bind(array(':product_id' => 1));
 
         $this->assertType('Zend_Db_Select', $select,