Parcourir la source

ZF-11127
Zend_Controller
Unit test to show that issue reported by ZF-11127 no longer exists


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

adamlundrigan il y a 14 ans
Parent
commit
c9981c4ac5
1 fichiers modifiés avec 19 ajouts et 0 suppressions
  1. 19 0
      tests/Zend/Controller/Action/Helper/ViewRendererTest.php

+ 19 - 0
tests/Zend/Controller/Action/Helper/ViewRendererTest.php

@@ -839,6 +839,25 @@ class Zend_Controller_Action_Helper_ViewRendererTest extends PHPUnit_Framework_T
         $body = $this->response->getBody();
         $this->assertContains('SampleZfHelper invoked', $body, 'Received ' . $body);
     }
+    
+    /**
+     * @group ZF-11127
+     */
+    public function testViewSuffixInstanceNotSharedWhenViewHelperIsCloned()
+    {
+        $a = new Zend_Controller_Action_Helper_ViewRenderer();
+        $a->init();
+        $a->setViewSuffix('A');
+        
+        $this->assertEquals('A', $a->getViewSuffix());
+        
+        $b = clone $a;        
+        $this->assertEquals('A', $b->getViewSuffix());
+        $b->setViewSuffix('B');
+        
+        $this->assertEquals('B', $b->getViewSuffix());
+        $this->assertNotEquals('B', $a->getViewSuffix());
+    }
 
     protected function _normalizePath($path)
     {