These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Azine\EmailUpdateConfirmationBundle\Routing; |
||
4 | |||
5 | use Symfony\Component\Config\FileLocator; |
||
6 | use Symfony\Component\Routing\Loader\YamlFileLoader; |
||
7 | use Symfony\Component\Routing\RouteCollection; |
||
8 | |||
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); |
||
0 ignored issues
–
show
|
|||
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() |
||
37 | { |
||
38 | return array( |
||
39 | array('user_update_email_confirm', '/{_locale}/confirm-email-update/{token}/{redirectRoute}', array('GET')), |
||
40 | ); |
||
41 | } |
||
42 | } |
||
43 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: