Ver código fonte

[ZF-11988] Update regex to allow namespaced frontend and backend classes in Zend_Cache::factory

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24655 44c647ce-9c0f-0410-b52a-842ac1e357ba
adamlundrigan 14 anos atrás
pai
commit
f899911e96
1 arquivos alterados com 26 adições e 0 exclusões
  1. 26 0
      tests/Zend/Cache/FactoryTest.php

+ 26 - 0
tests/Zend/Cache/FactoryTest.php

@@ -113,5 +113,31 @@ class Zend_Cache_FactoryTest extends PHPUnit_Framework_TestCase
         }
         $this->fail('Zend_Exception was expected but not thrown');
     }
+    
+    /**
+     * @group ZF-11988
+     */
+    public function testNamespacedFrontendClassAccepted()
+    {
+        try {
+            Zend_Cache::factory('ZF11988\Frontend', 'File', array(), array(), true, false, false);
+            $this->fail('Zend_Cache_Exception was expected but not thrown');
+        } catch ( Zend_Cache_Exception $e ) {
+            $this->assertNotEquals('Invalid frontend name [ZF11988\Frontend]', $e->getMessage());
+        }
+    }
+    
+    /**
+     * @group ZF-11988
+     */
+    public function testNamespacedBackendClassAccepted()
+    {
+        try {
+            Zend_Cache::factory('Output', 'ZF11988\Backend', array(), array(), false, true, false);
+            $this->fail('Zend_Cache_Exception was expected but not thrown');
+        } catch ( Zend_Cache_Exception $e ) {
+            $this->assertNotEquals('Invalid backend name [ZF11988\Backend]', $e->getMessage());
+        }
+    }
 
 }