/** * @test */ public function addingMatcherIsImmutable() { $matcher = $this->getMock(Matcher::class); $route = Route::create('/user/[:id]'); $route2 = $route->ifMatches('id', $matcher); $this->assertInstanceOf(Route::class, $route2); $this->assertNotEquals($route->getMatchers(), $route2->getMatchers()); }
/** * @test * @expectedException \ConfigurationException */ public function throwsAnExceptionIfAddedRouteHasNoMethodDefined() { $this->router->addRoute(Route::create()->to('someaction')); }