diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index c77598c82c..580d7eebd7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -82,7 +82,7 @@ class TextDescriptor extends Descriptor $tableHeaders = array('Property', 'Value'); $tableRows = array( - array('Route Name', $options['name']), + array('Route Name', isset($options['name']) ? $options['name'] : ''), array('Path', $route->getPath()), array('Path Regex', $route->compile()->getRegex()), array('Host', ('' !== $route->getHost() ? $route->getHost() : 'ANY')), diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php index 25d9a72b96..1d1a5cf94e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php @@ -25,7 +25,8 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase $ret = $tester->execute(array('name' => null), array('decorated' => false)); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); - $this->assertContains('[router] Current routes', $tester->getDisplay()); + $this->assertContains('Path', $tester->getDisplay()); + $this->assertContains('/foo', $tester->getDisplay()); } public function testDebugSingleRoute() @@ -34,7 +35,7 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase $ret = $tester->execute(array('name' => 'foo'), array('decorated' => false)); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); - $this->assertContains('[router] Route "foo"', $tester->getDisplay()); + $this->assertContains('Route Name | foo', $tester->getDisplay()); } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php index 93c2468dc1..3c17285750 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php @@ -27,7 +27,7 @@ class RouterMatchCommandTest extends \PHPUnit_Framework_TestCase $ret = $tester->execute(array('path_info' => '/foo', 'foo'), array('decorated' => false)); $this->assertEquals(0, $ret, 'Returns 0 in case of success'); - $this->assertContains('[router] Route "foo"', $tester->getDisplay()); + $this->assertContains('Route Name | foo', $tester->getDisplay()); } public function testWithNotMatchPath() diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt index 1c07ccde50..587543fb0a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt @@ -1,12 +1,17 @@ -Path /hello/{name} -Path Regex #^/hello(?:/(?P[a-z]+))?$#s -Host localhost -Host Regex #^localhost$#si -Scheme http|https -Method GET|HEAD -Class Symfony\Component\Routing\Route -Defaults name: Joseph -Requirements name: [a-z]+ -Options compiler_class: Symfony\Component\Routing\RouteCompiler - opt1: val1 - opt2: val2 ++--------------+---------------------------------------------------------+ +| Property | Value | ++--------------+---------------------------------------------------------+ +| Route Name | | +| Path | /hello/{name} | +| Path Regex | #^/hello(?:/(?P[a-z]+))?$#s | +| Host | localhost | +| Host Regex | #^localhost$#si | +| Scheme | http|https | +| Method | GET|HEAD | +| Requirements | name: [a-z]+ | +| Class | Symfony\Component\Routing\Route | +| Defaults | name: Joseph | +| Options | compiler_class: Symfony\Component\Routing\RouteCompiler | +| | opt1: val1 | +| | opt2: val2 | ++--------------+---------------------------------------------------------+ diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt index 560c474ae9..e75c19e131 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt @@ -1,12 +1,17 @@ -Path /name/add -Path Regex #^/name/add$#s -Host localhost -Host Regex #^localhost$#si -Scheme http|https -Method PUT|POST -Class Symfony\Component\Routing\Route -Defaults NONE -Requirements NO CUSTOM -Options compiler_class: Symfony\Component\Routing\RouteCompiler - opt1: val1 - opt2: val2 ++--------------+---------------------------------------------------------+ +| Property | Value | ++--------------+---------------------------------------------------------+ +| Route Name | | +| Path | /name/add | +| Path Regex | #^/name/add$#s | +| Host | localhost | +| Host Regex | #^localhost$#si | +| Scheme | http|https | +| Method | PUT|POST | +| Requirements | NO CUSTOM | +| Class | Symfony\Component\Routing\Route | +| Defaults | NONE | +| Options | compiler_class: Symfony\Component\Routing\RouteCompiler | +| | opt1: val1 | +| | opt2: val2 | ++--------------+---------------------------------------------------------+ diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.txt index 31c796685b..ab487d4620 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.txt +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.txt @@ -1,4 +1,6 @@ -[router] Current routes - Name  Method  Scheme  Host  Path  - route_1 GET|HEAD http|https localhost /hello/{name} - route_2 PUT|POST http|https localhost /name/add ++---------+----------+------------+-----------+---------------+ +| Name | Method | Scheme | Host | Path | ++---------+----------+------------+-----------+---------------+ +| route_1 | GET|HEAD | http|https | localhost | /hello/{name} | +| route_2 | PUT|POST | http|https | localhost | /name/add | ++---------+----------+------------+-----------+---------------+