Skip to content

Commit 6dd1d61

Browse files
committed
fixed some routing patterns
1 parent 1f88edd commit 6dd1d61

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* }
4646
*
4747
* /**
48-
* * @Route("/:id", name="blog_post", requirements = {"id" = "\d+"})
48+
* * @Route("/{id}", name="blog_post", requirements = {"id" = "\d+"})
4949
* * /
5050
* public function show()
5151
* {

tests/Symfony/Tests/Component/Routing/CompiledRouteTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CompiledRouteTest extends \PHPUnit_Framework_TestCase
1818
{
1919
public function testAccessors()
2020
{
21-
$route = new Route('/:foo', array('foo' => 'bar'), array('foo' => '\d+'), array('foo' => 'bar'));
21+
$route = new Route('/{foo}', array('foo' => 'bar'), array('foo' => '\d+'), array('foo' => 'bar'));
2222

2323
$compiled = new CompiledRoute($route, 'prefix', 'regex', array('tokens'), array('variables'));
2424
$this->assertEquals($route, $compiled->getRoute(), '__construct() takes a route as its first argument');
@@ -30,10 +30,10 @@ public function testAccessors()
3030

3131
public function testgetPatterngetDefaultsgetOptionsgetRequirements()
3232
{
33-
$route = new Route('/:foo', array('foo' => 'bar'), array('foo' => '\d+'), array('foo' => 'bar'));
33+
$route = new Route('/{foo}', array('foo' => 'bar'), array('foo' => '\d+'), array('foo' => 'bar'));
3434

3535
$compiled = new CompiledRoute($route, 'prefix', 'regex', array('tokens'), array('variables'));
36-
$this->assertEquals('/:foo', $compiled->getPattern(), '->getPattern() returns the route pattern');
36+
$this->assertEquals('/{foo}', $compiled->getPattern(), '->getPattern() returns the route pattern');
3737
$this->assertEquals(array('foo' => 'bar'), $compiled->getDefaults(), '->getDefaults() returns the route defaults');
3838
$this->assertEquals(array('foo' => '\d+'), $compiled->getRequirements(), '->getRequirements() returns the route requirements');
3939
$this->assertEquals(array_merge(array(

tests/Symfony/Tests/Component/Routing/Matcher/UrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase
2020
public function testNormalizeUrl()
2121
{
2222
$collection = new RouteCollection();
23-
$collection->add('foo', new Route('/:foo'));
23+
$collection->add('foo', new Route('/{foo}'));
2424

2525
$matcher = new UrlMatcherForTests($collection, array(), array());
2626

0 commit comments

Comments
 (0)