| Total Complexity | 2 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 9 | class RoutingTest extends \PHPUnit\Framework\TestCase |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @dataProvider loadRoutingProvider |
||
| 13 | * |
||
| 14 | * @param string $routeName |
||
| 15 | * @param string $path |
||
| 16 | * @param array $methods |
||
| 17 | */ |
||
| 18 | public function testLoadRouting($routeName, $path, array $methods) |
||
| 19 | { |
||
| 20 | $locator = new FileLocator(); |
||
| 21 | $loader = new YamlFileLoader($locator); |
||
| 22 | |||
| 23 | $collection = new RouteCollection(); |
||
| 24 | $subCollection = $loader->load(__DIR__.'/../../Resources/config/routing.yml'); |
||
| 25 | $collection->addCollection($subCollection); |
||
| 26 | |||
| 27 | $route = $collection->get($routeName); |
||
| 28 | $this->assertNotNull($route, sprintf('The route "%s" should exists', $routeName)); |
||
| 29 | $this->assertSame($path, $route->getPath()); |
||
| 30 | $this->assertSame($methods, $route->getMethods()); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return array |
||
| 35 | */ |
||
| 36 | public function loadRoutingProvider() |
||
| 40 | ); |
||
| 41 | } |
||
| 43 |