Hi,

I observe some nasty differences between these two objects behavior

Zend_Controller_Request_Http
Zend_Controller_Request_HttpTestCase


If we navigate to a URI like this: '/modulename/123/456/' and printout this
two objects 
in _routeStartup() hook we see:

for regular request object:

[_requestUri:protected] => /modulename/123/456/
[_baseUrl:protected] => 
[_basePath:protected] => 
[_pathInfo:protected] => 

As you see the protected _pathInfo parameter is not yet set that is correct
since it is being set 
at the process of routing.


for testcase request object:

[_requestUri:protected] => /modulename/123/456/
[_baseUrl:protected] => 
[_basePath:protected] => 
[_pathInfo:protected] => /modulename/123/456/


But for the second (testcase) request object it is already set. For that
reason it is not being
set correctly at the process of routing.

That results in the 'baseUrl' parameter being ignored when doing routing and
calculating path info.
That in turn results in incorrect routing in testing environment when using
$request->setBaseUrl('/modulename');


Here's an example plugin that illustrates the point


        public function routeStartup()
        {
           $this->getRequest()->setBaseUrl('/modulename');
        }
        public function routeShutdown()
        {
        echo '<pre>';
        print_r($this->getRequest());
        die();
        }
        
So after baseUrl was set  module/contoller/action are being calculated
incorrectly 
in testing environment.



I don't know if it is the expected behavior or a known case and going to
investigate further.
So if you know something about this issue - please let me know.


Dmitry.
-- 
View this message in context: 
http://www.nabble.com/Incorrect-dispatch-in-testing-environment-due-to-baseUrl-being-set.-tp26040343p26040343.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to