Ver Fonte

[ZF-6161] setDefaultMetadataCache throw exception after restart the memcached
- Changed from a throw to a trigger_error(user_notice)



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

tech13 há 16 anos atrás
pai
commit
55f415a16d

+ 1 - 5
library/Zend/Db/Table/Abstract.php

@@ -823,11 +823,7 @@ abstract class Zend_Db_Table_Abstract
             $metadata = $this->_db->describeTable($this->_name, $this->_schema);
             // If $this has a metadata cache, then cache the metadata
             if (null !== $this->_metadataCache && !$this->_metadataCache->save($metadata, $cacheId)) {
-                /**
-                 * @see Zend_Db_Table_Exception
-                 */
-                require_once 'Zend/Db/Table/Exception.php';
-                throw new Zend_Db_Table_Exception('Failed saving metadata to metadataCache');
+                trigger_error('Failed saving metadata to metadataCache', E_USER_NOTICE);
             }
         }
 

+ 3 - 3
tests/Zend/Db/Table/TestCommon.php

@@ -1304,9 +1304,9 @@ abstract class Zend_Db_Table_TestCommon extends Zend_Db_Table_TestSetup
         try {
             $bugsTable = $this->_getTable('My_ZendDbTable_TableBugs');
             $primary = $bugsTable->info(Zend_Db_Table_Abstract::PRIMARY);
-            $this->fail('Expected to catch Zend_Db_Table_Exception');
-        } catch (Zend_Exception $e) {
-            $this->assertType('Zend_Db_Table_Exception', $e);
+            $this->fail('Expected to catch PHPUnit_Framework_Error');
+        } catch (PHPUnit_Framework_Error $e) {
+            $this->assertEquals(E_USER_NOTICE, $e->getCode(), 'Error type not E_USER_NOTICE');
             $this->assertEquals('Failed saving metadata to metadataCache', $e->getMessage());
         }