$request = new myRequest($dispatcher); $_SERVER['SCRIPT_NAME'] = '/frontend_test.php'; $_SERVER['REQUEST_URI'] = '/frontend_test.php/test/klaus2'; $_SERVER['QUERY_STRING'] = ''; $t->is($request->getPathInfo(), '/test/klaus2', '->getPathInfo() returns the url path value if it not exists use default REQUEST_URI'); $request = new myRequest($dispatcher); $_SERVER['QUERY_STRING'] = 'test'; $_SERVER['REQUEST_URI'] = '/frontend_test.php/test/klaus2?test'; $t->is($request->getPathInfo(), '/test/klaus2', '->getPathInfo() returns the url path value if it not exists use default REQUEST_URI without query'); $request->resetPathInfoArray(); $request = new myRequest($dispatcher); $t->is($request->getPathInfo(), '/', '->getPathInfo() returns the url path value if it not exists use default /'); // -setRelativeUrlRoot() ->getRelativeUrlRoot() $t->diag('-setRelativeUrlRoot() ->getRelativeUrlRoot()'); $t->is($request->getRelativeUrlRoot(), '', '->getRelativeUrlRoot() return computed relative url root'); $request->setRelativeUrlRoot('toto'); $t->is($request->getRelativeUrlRoot(), 'toto', '->getRelativeUrlRoot() return previously set relative url root'); // ->addRequestParameters() ->getRequestParameters() ->fixParameters() $t->diag('->addRequestParameters() ->getRequestParameters() ->fixParameters()'); $request = new myRequest($dispatcher); $t->is($request->getRequestParameters(), array(), '->getRequestParameters() returns the request parameters default array'); $request->addRequestParameters(array('test' => 'test')); $t->is($request->getRequestParameters(), array('test' => 'test'), '->getRequestParameters() returns the request parameters'); $request->addRequestParameters(array('test' => 'test')); $t->is($request->getRequestParameters(), array('test' => 'test'), '->getRequestParameters() returns the request parameters allready exists'); $request->addRequestParameters(array('_sf_ignore_cache' => 1, 'test2' => 'test2')); $t->is($request->getRequestParameters(), array('test' => 'test', 'test2' => 'test2', '_sf_ignore_cache' => 1), '->getRequestParameters() returns the request parameters check fixParameters call for special _sf_ params'); $t->is($request->getAttribute('sf_ignore_cache'), 1, '->getAttribute() check special param is set as attribute'); // ->getUrlParameter $t->diag('->getUrlParameter()'); $t->is($request->getUrlParameter('test'), 'test', '->getUrlParameter() returns URL parameter by name');