Jeremy Quinton 12 лет назад
Родитель
Сommit
14a1966b31
2 измененных файлов с 27 добавлено и 1 удалено
  1. 3 0
      library/Zend/Cache/Backend/Test.php
  2. 24 1
      tests/Zend/Cache/ClassFrontendTest.php

+ 3 - 0
library/Zend/Cache/Backend/Test.php

@@ -125,6 +125,9 @@ class Zend_Cache_Backend_Test extends Zend_Cache_Backend implements Zend_Cache_B
           || $id == '4a923ef02d7f997ca14d56dfeae25ea7') {
             return serialize(array('foo', 'bar'));
         }
+        if ( $id == 'f53c7d912cc523d9a65834c8286eceb9') {
+            return serialize(array('foobar'));
+        }
         return 'foo';
     }
 

+ 24 - 1
tests/Zend/Cache/ClassFrontendTest.php

@@ -54,12 +54,20 @@ class test {
         return "foobar2_return($param1, $param2)";
     }
 
+    public function foobar3($param1, $param2)
+    {
+        echo $this->dummyMethod($param1, $param2);
+    }
+
+    private function dummyMethod($param1, $param2) {
+        return "foobar_output($param1,$param2)";
+    }
+
     public function throwException()
     {
         echo 'throw exception';
         throw new Exception('test exception');
     }
-
 }
 
 /**
@@ -220,6 +228,21 @@ class Zend_Cache_ClassFrontendTest extends PHPUnit_Framework_TestCase {
         $this->assertEquals('foobar_output(param1, param2)', $data);
     }
 
+    public function testCallCorrectCall8()
+    {
+        $this->_instance2->setOption('cache_by_default', true);
+        $this->_instance2->setOption('cached_methods', array('foobar3'));
+        ob_start();
+        ob_implicit_flush(false);
+        $return = $this->_instance2->foobar3('param1', 'param2');
+        $data = ob_get_clean();
+        ob_implicit_flush(true);
+
+        $this->assertNull($return);
+        $this->assertEquals('foobar_output(param1,param2)',$data);
+      
+    }
+
     public function testConstructorWithABadCachedEntity()
     {
         try {