Pārlūkot izejas kodu

[ZF-9737] Unittests:

- Fixed added test.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22617 44c647ce-9c0f-0410-b52a-842ac1e357ba
ramon 15 gadi atpakaļ
vecāks
revīzija
18240fc278
1 mainītis faili ar 41 papildinājumiem un 0 dzēšanām
  1. 41 0
      tests/Zend/Application/Resource/CacheManagerTest.php

+ 41 - 0
tests/Zend/Application/Resource/CacheManagerTest.php

@@ -45,6 +45,16 @@ require_once 'Zend/Controller/Front.php';
 require_once 'Zend/Application/Resource/Cachemanager.php';
 
 /**
+ * Zend_Cache_Backend
+ */
+require_once 'Zend/Cache/Backend.php';
+
+/**
+ * Zend_Cache_Core
+ */
+require_once 'Zend/Cache/Core.php';
+
+/**
  * @category   Zend
  * @package    Zend_Application
  * @subpackage UnitTests
@@ -210,6 +220,37 @@ class Zend_Application_Resource_CacheManagerTest extends PHPUnit_Framework_TestC
         $cache = $manager->getCache('foo')->getBackend();
         $this->assertTrue($cache instanceof Zend_Cache_Backend_ZendServer_Disk);
     }
+
+    /**
+     * @group ZF-9737
+     */
+    public function testCustomFrontendBackendNaming()
+    {
+        $options = array(
+            'zf9737' => array(
+                'frontend' => array(
+                    'name'                 => 'custom-naming',
+                    'customFrontendNaming' => false),
+                'backend' => array('name'                    => 'Zend_Cache_Backend_Custom_Naming',
+                                   'customBackendNaming'     => true),
+                'frontendBackendAutoload' => true)
+        );
+
+        $resource = new Zend_Application_Resource_Cachemanager($options);
+        $manager  = $resource->init();
+        $cache    = $manager->getCache('zf9737');
+        $this->assertTrue($cache->getBackend() instanceof Zend_Cache_Backend_Custom_Naming);
+        $this->assertTrue($cache instanceof Zend_Cache_Frontend_CustomNaming);
+    }
+}
+
+
+class Zend_Cache_Backend_Custom_Naming extends Zend_Cache_Backend
+{
+}
+
+class Zend_Cache_Frontend_CustomNaming extends Zend_Cache_Core
+{
 }
 
 if (PHPUnit_MAIN_METHOD == 'Zend_Application_Resource_CacheManagerTest::main') {