minor #15997 [FrameworkBundle] Fix tests (nicolas-grekas)
This PR was merged into the 2.8 branch.
Discussion
----------
[FrameworkBundle] Fix tests
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
#14132 missed tests updates
Commits
-------
5549f4c
[FrameworkBundle] Fix tests
This commit is contained in:
commit
b630972379
@ -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')),
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
+--------------+---------------------------------------------------------+
|
||||
|[32m Property [39m|[32m Value [39m|
|
||||
+--------------+---------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------+---------------------------------------------------------+
|
||||
|
@ -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
|
||||
+--------------+---------------------------------------------------------+
|
||||
|[32m Property [39m|[32m Value [39m|
|
||||
+--------------+---------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------+---------------------------------------------------------+
|
||||
|
@ -1,4 +1,6 @@
|
||||
<info>[router]</info> Current routes
|
||||
[32mName [39m [32mMethod [39m [32mScheme [39m [32mHost [39m [32mPath [39m
|
||||
route_1 GET|HEAD http|https localhost /hello/{name}
|
||||
route_2 PUT|POST http|https localhost /name/add
|
||||
+---------+----------+------------+-----------+---------------+
|
||||
|[32m Name [39m|[32m Method [39m|[32m Scheme [39m|[32m Host [39m|[32m Path [39m|
|
||||
+---------+----------+------------+-----------+---------------+
|
||||
| route_1 | GET|HEAD | http|https | localhost | /hello/{name} |
|
||||
| route_2 | PUT|POST | http|https | localhost | /name/add |
|
||||
+---------+----------+------------+-----------+---------------+
|
||||
|
Reference in New Issue
Block a user