| Conditions | 3 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function testGenerateRoutes() |
||
| 11 | { |
||
| 12 | if (Kernel::MAJOR_VERSION === '2' && Kernel::MINOR_VERSION === '7') { |
||
| 13 | $environment = 'symfony27'; |
||
| 14 | } else { |
||
| 15 | $environment = 'symfony' . Kernel::MAJOR_VERSION; |
||
| 16 | } |
||
| 17 | |||
| 18 | $client = static::createClient(array('environment' => $environment)); |
||
| 19 | |||
| 20 | $container = $client->getContainer(); |
||
| 21 | |||
| 22 | $pathHelper = new PathHelper($container); |
||
|
|
|||
| 23 | |||
| 24 | // test route is defined in Tests/app/routing.yml |
||
| 25 | $routes = $pathHelper->generateRoutes(['test_route' => []]); |
||
| 26 | |||
| 27 | $this->assertEquals(['api.test_route = "/monitor";'], $routes); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: