public function testRedirectUri() { $root = $this->getDm()->find(null, self::ROUTE_ROOT); $redirect = new RedirectRoute(); $redirect->setPosition($root, 'redirectUri'); $redirect->setUri('http://example.com/test-url'); $redirect->setParameters(array('test' => 7)); // parameters should be ignored in this case $redirect->setPermanent(true); $this->getDm()->persist($redirect); $this->getDm()->flush(); $this->getDm()->clear(); $redirect = $this->getDm()->find(null, self::ROUTE_ROOT . '/redirectUri'); $response = $this->controller->redirectAction($redirect); $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $response); $this->assertSame(301, $response->getStatusCode()); $this->assertSame('http://example.com/test-url', $response->getTargetUrl()); }