Skip to content

[FrameworkBundle] Fix tests #15997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function describeRoute(Route $route, array $options = array())

$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')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public function testDebugAllRoutes()
$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()
Expand All @@ -34,7 +35,7 @@ public function testDebugSingleRoute()
$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());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testWithMatchPath()
$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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<comment>Path</comment> /hello/{name}
<comment>Path Regex</comment> #^/hello(?:/(?P<name>[a-z]+))?$#s
<comment>Host</comment> localhost
<comment>Host Regex</comment> #^localhost$#si
<comment>Scheme</comment> http|https
<comment>Method</comment> GET|HEAD
<comment>Class</comment> Symfony\Component\Routing\Route
<comment>Defaults</comment> name: Joseph
<comment>Requirements</comment> name: [a-z]+
<comment>Options</comment> compiler_class: Symfony\Component\Routing\RouteCompiler
opt1: val1
opt2: val2
+--------------+---------------------------------------------------------+
| Property | Value |
+--------------+---------------------------------------------------------+
| Route Name | |
| Path | /hello/{name} |
| Path Regex | #^/hello(?:/(?P<name>[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 |
+--------------+---------------------------------------------------------+
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<comment>Path</comment> /name/add
<comment>Path Regex</comment> #^/name/add$#s
<comment>Host</comment> localhost
<comment>Host Regex</comment> #^localhost$#si
<comment>Scheme</comment> http|https
<comment>Method</comment> PUT|POST
<comment>Class</comment> Symfony\Component\Routing\Route
<comment>Defaults</comment> NONE
<comment>Requirements</comment> NO CUSTOM
<comment>Options</comment> 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 |
+--------------+---------------------------------------------------------+
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<info>[router]</info> 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 |
+---------+----------+------------+-----------+---------------+