/** * @covers Kunstmaan\RedirectBundle\Router\RedirectRouter::match */ public function testMatch() { $redirect = $this->firstObject->match('/test1'); $this->assertEquals(array('_controller' => 'FrameworkBundle:Redirect:urlRedirect', 'path' => '/target1', 'permanent' => false, '_route' => '_redirect_route_1'), $redirect); $redirect = $this->firstObject->match('/test2'); $this->assertEquals(array('_controller' => 'FrameworkBundle:Redirect:urlRedirect', 'path' => '/target2', 'permanent' => true, '_route' => '_redirect_route_2'), $redirect); $redirect = $this->firstObject->match('/test3'); $this->assertEquals(array('_controller' => 'FrameworkBundle:Redirect:urlRedirect', 'path' => '/target3', 'permanent' => true, '_route' => '_redirect_route_3'), $redirect); $this->setExpectedException('Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException'); $this->firstObject->match('/testnotfound'); $this->setExpectedException('Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException'); $this->firstObject->match('/test4'); $redirect = $this->secondObject->match('/test4'); $this->assertEquals(array('_controller' => 'FrameworkBundle:Redirect:urlRedirect', 'path' => '/target4', 'permanent' => true, '_route' => '_redirect_route_4'), $redirect); }
/** * @covers Kunstmaan\RedirectBundle\Router\RedirectRouter::match */ public function testMatch() { $redirect = $this->object->match('/test2'); $this->assertEquals(array('_controller' => 'FrameworkBundle:Redirect:urlRedirect', 'path' => '/target2', 'permanent' => true, '_route' => '_redirect_route_2'), $redirect); }