Просмотр исходного кода

ZF-8809
- fixed various mysql tests and issues

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20513 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 16 лет назад
Родитель
Сommit
26a3be2199

+ 2 - 2
library/Zend/Db/Statement/Exception.php

@@ -43,7 +43,7 @@ class Zend_Db_Statement_Exception extends Zend_Db_Exception
      */
      */
     public function hasChainedException()
     public function hasChainedException()
     {
     {
-        return ($this->_previous !== null);
+        return ($this->getPrevious() !== null);
     }
     }
 
 
     /**
     /**
@@ -51,6 +51,6 @@ class Zend_Db_Statement_Exception extends Zend_Db_Exception
      */
      */
     public function getChainedException()
     public function getChainedException()
     {
     {
-        return $this->_previous;
+        return $this->getPrevious();
     }
     }
 }
 }

+ 4 - 2
tests/Zend/Db/Statement/Pdo/TestCommon.php

@@ -94,8 +94,10 @@ abstract class Zend_Db_Statement_Pdo_TestCommon extends Zend_Db_Statement_TestCo
         } catch (Zend_Exception $e) {
         } catch (Zend_Exception $e) {
             $this->assertType('Zend_Db_Statement_Exception', $e,
             $this->assertType('Zend_Db_Statement_Exception', $e,
                 'Expecting object of type Zend_Db_Statement_Exception, got '.get_class($e));
                 'Expecting object of type Zend_Db_Statement_Exception, got '.get_class($e));
-            $this->assertTrue($e->hasChainedException());
-            $this->assertType('PDOException', $e->getChainedException());
+//            $this->assertTrue($e->hasChainedException());
+//            $this->assertType('PDOException', $e->getChainedException());
+            $this->assertTrue($e->hasChainedException(), 'Missing Chained Exception');
+            $this->assertType('PDOException', $e->getChainedException(), 'Wrong type of Exception');
         }
         }
     }
     }
 
 

+ 1 - 1
tests/Zend/Db/Statement/TestCommon.php

@@ -324,7 +324,7 @@ abstract class Zend_Db_Statement_TestCommon extends Zend_Db_TestSetup
         } catch (Zend_Exception $e) {
         } catch (Zend_Exception $e) {
             $this->assertType('Zend_Db_Statement_Exception', $e,
             $this->assertType('Zend_Db_Statement_Exception', $e,
                 'Expecting object of type Zend_Db_Statement_Exception, got '.get_class($e));
                 'Expecting object of type Zend_Db_Statement_Exception, got '.get_class($e));
-            $this->assertContains('invalid fetch mode', $e->getMessage());
+            $this->assertRegExp('#invalid fetch mode#i', $e->getMessage());
         }
         }
     }
     }
 
 

+ 1 - 0
tests/Zend/Db/Table/Select/TestCommon.php

@@ -62,6 +62,7 @@ abstract class Zend_Db_Table_Select_TestCommon extends Zend_Db_Select_TestCommon
         if ($this->_runtimeIncludePath) {
         if ($this->_runtimeIncludePath) {
             $this->_restoreIncludePath();
             $this->_restoreIncludePath();
         }
         }
+        parent::tearDown();
     }
     }
 
 
     protected function _getTable($tableClass, $options = array())
     protected function _getTable($tableClass, $options = array())

+ 1 - 0
tests/Zend/Db/Table/TestSetup.php

@@ -64,6 +64,7 @@ abstract class Zend_Db_Table_TestSetup extends Zend_Db_TestSetup
         if ($this->_runtimeIncludePath) {
         if ($this->_runtimeIncludePath) {
             $this->_restoreIncludePath();
             $this->_restoreIncludePath();
         }
         }
+        parent::tearDown();
     }
     }
 
 
     protected function _getTable($tableClass, $options = array())
     protected function _getTable($tableClass, $options = array())

+ 1 - 0
tests/Zend/Db/TestSetup.php

@@ -117,6 +117,7 @@ abstract class Zend_Db_TestSetup extends PHPUnit_Framework_TestCase
     public function tearDown()
     public function tearDown()
     {
     {
         $this->_util->tearDown();
         $this->_util->tearDown();
+        $this->_db->closeConnection();
         $this->_db = null;
         $this->_db = null;
     }
     }