Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed some routing patterns
  • Loading branch information
fabpot committed Jan 12, 2011
1 parent 1f88edd commit 6dd1d61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -45,7 +45,7 @@
* }
*
* /**
* * @Route("/:id", name="blog_post", requirements = {"id" = "\d+"})
* * @Route("/{id}", name="blog_post", requirements = {"id" = "\d+"})
* * /
* public function show()
* {
Expand Down
6 changes: 3 additions & 3 deletions tests/Symfony/Tests/Component/Routing/CompiledRouteTest.php
Expand Up @@ -18,7 +18,7 @@ class CompiledRouteTest extends \PHPUnit_Framework_TestCase
{
public function testAccessors()
{
$route = new Route('/:foo', array('foo' => 'bar'), array('foo' => '\d+'), array('foo' => 'bar'));
$route = new Route('/{foo}', array('foo' => 'bar'), array('foo' => '\d+'), array('foo' => 'bar'));

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

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

$compiled = new CompiledRoute($route, 'prefix', 'regex', array('tokens'), array('variables'));
$this->assertEquals('/:foo', $compiled->getPattern(), '->getPattern() returns the route pattern');
$this->assertEquals('/{foo}', $compiled->getPattern(), '->getPattern() returns the route pattern');
$this->assertEquals(array('foo' => 'bar'), $compiled->getDefaults(), '->getDefaults() returns the route defaults');
$this->assertEquals(array('foo' => '\d+'), $compiled->getRequirements(), '->getRequirements() returns the route requirements');
$this->assertEquals(array_merge(array(
Expand Down
Expand Up @@ -20,7 +20,7 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase
public function testNormalizeUrl()
{
$collection = new RouteCollection();
$collection->add('foo', new Route('/:foo'));
$collection->add('foo', new Route('/{foo}'));

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

Expand Down

0 comments on commit 6dd1d61

Please sign in to comment.