added test to ensure matching is eager

This commit is contained in:
Tobias Schultze 2012-05-08 10:13:04 +02:00
parent 919604ab71
commit 49e99572be

View File

@ -206,6 +206,15 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase
}
}
public function testMatchingIsEager()
{
$coll = new RouteCollection();
$coll->add('test', new Route('/{foo}-{bar}-', array(), array('foo' => '.+', 'bar' => '.+')));
$matcher = new UrlMatcher($coll, new RequestContext());
$this->assertEquals(array('foo' => 'text1-text2-text3', 'bar' => 'text4', '_route' => 'test'), $matcher->match('/text1-text2-text3-text4-'));
}
/**
* @expectedException Symfony\Component\Routing\Exception\ResourceNotFoundException
*/