Browse Source

fixing issue ZF-9859, making Zend_Controller_Action_Helper_Redirector::gotoUrlAndExit() consistent with other exit methods

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22957 44c647ce-9c0f-0410-b52a-842ac1e357ba
dragonbe 15 years ago
parent
commit
5c119a1cb2

+ 1 - 1
library/Zend/Controller/Action/Helper/Redirector.php

@@ -463,7 +463,7 @@ class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_He
      */
     public function gotoUrlAndExit($url, array $options = array())
     {
-        $this->gotoUrl($url, $options);
+        $this->setGotoUrl($url, $options);
         $this->redirectAndExit();
     }
 

+ 11 - 0
tests/Zend/Controller/Action/Helper/RedirectorTest.php

@@ -492,6 +492,17 @@ class Zend_Controller_Action_Helper_RedirectorTest extends PHPUnit_Framework_Tes
         $this->assertNotContains('https://', $test);
         $this->assertEquals('http://localhost/bar/baz', $test);
     }
+    
+    /**
+     * @group ZF-9859
+     */
+    public function testGotoUrlAndSetGotoUrlBehaveTheSame()
+    {
+        $url = 'http://www.example.com';
+        $gotoUrl = $this->redirector->gotoUrl($url);
+        $setGotoUrl = $this->redirector->setGotoUrl($url);
+        $this->assertSame($gotoUrl, $setGotoUrl);
+    }
 
     /**#@-*/
 }