public function testUrlizeThrowsAnExceptionIfItCantFindARoute() { $PersonRoute = $this->mock('AkRoute', array('urlize' => new RouteDoesNotMatchParametersException())); $this->Router->addRoute('person', $PersonRoute); $this->expectException('NoMatchingRouteException'); $this->Router->urlize(array('not' => 'found')); }
function testUrlizeThrowsAnExceptionIfItCantFindARoute() { $PersonRoute = $this->getMock('AkRoute', array(), array('person/:name')); $PersonRoute->expects($this->once())->method('urlize')->with(array('not' => 'found'))->will($this->throwException(new RouteDoesNotMatchParametersException())); $this->Router->addRoute('person', $PersonRoute); $this->setExpectedException('NoMatchingRouteException'); $this->Router->urlize(array('not' => 'found')); }