for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Azine\EmailUpdateConfirmationBundle\Routing;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Routing\Loader\YamlFileLoader;
use Symfony\Component\Routing\RouteCollection;
class RoutingTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider loadRoutingProvider
*
* @param string $routeName
* @param string $path
* @param array $methods
*/
public function testLoadRouting($routeName, $path, array $methods)
$locator = new FileLocator();
$loader = new YamlFileLoader($locator);
$collection = new RouteCollection();
$subCollection = $loader->load(__DIR__.'/../../Resources/config/routing.yml');
$collection->addCollection($subCollection);
$subCollection
object<Symfony\Component\Routing\RouteCollection>
object<self>
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:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$route = $collection->get($routeName);
$this->assertNotNull($route, sprintf('The route "%s" should exists', $routeName));
$this->assertSame($path, $route->getPath());
$this->assertSame($methods, $route->getMethods());
}
* @return array
public function loadRoutingProvider()
return array(
array('user_update_email_confirm', '/{_locale}/confirm-email-update/{token}/{redirectRoute}', array('GET')),
);
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: