From 49e99572be3d8710818a226f36fdfbfa2699abb6 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Tue, 8 May 2012 10:13:04 +0200 Subject: [PATCH] added test to ensure matching is eager --- .../Component/Routing/Tests/Matcher/UrlMatcherTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php index e38c75a030..b073348cb7 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php @@ -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 */