minor #14730 [Framework][router commands] fixed failing tests. (aitboudad)
This PR was merged into the 2.6 branch.
Discussion
----------
[Framework][router commands] fixed failing tests.
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Fixed tickets | #14432
| Tests pass? | yes
| License | MIT
Commits
-------
39cb661
[Framework][router commands] fixed failing test.
This commit is contained in:
commit
237996eb6e
@ -56,7 +56,7 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase
|
|||||||
$command->setContainer($this->getContainer());
|
$command->setContainer($this->getContainer());
|
||||||
$application->add($command);
|
$application->add($command);
|
||||||
|
|
||||||
return new CommandTester($application->find('router:debug'));
|
return new CommandTester($application->find('debug:router'));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getContainer()
|
private function getContainer()
|
||||||
@ -65,11 +65,15 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase
|
|||||||
$routeCollection->add('foo', new Route('foo'));
|
$routeCollection->add('foo', new Route('foo'));
|
||||||
$router = $this->getMock('Symfony\Component\Routing\RouterInterface');
|
$router = $this->getMock('Symfony\Component\Routing\RouterInterface');
|
||||||
$router
|
$router
|
||||||
->expects($this->atLeastOnce())
|
->expects($this->any())
|
||||||
->method('getRouteCollection')
|
->method('getRouteCollection')
|
||||||
->will($this->returnValue($routeCollection))
|
->will($this->returnValue($routeCollection))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$loader = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||||
$container
|
$container
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
@ -77,12 +81,13 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase
|
|||||||
->with('router')
|
->with('router')
|
||||||
->will($this->returnValue(true))
|
->will($this->returnValue(true))
|
||||||
;
|
;
|
||||||
|
|
||||||
$container
|
$container
|
||||||
->expects($this->atLeastOnce())
|
|
||||||
->method('get')
|
->method('get')
|
||||||
->with('router')
|
->will($this->returnValueMap(array(
|
||||||
->will($this->returnValue($router))
|
array('router', 1, $router),
|
||||||
;
|
array('controller_name_converter', 1, $loader),
|
||||||
|
)));
|
||||||
|
|
||||||
return $container;
|
return $container;
|
||||||
}
|
}
|
||||||
|
@ -74,19 +74,22 @@ class RouterMatchCommandTest extends \PHPUnit_Framework_TestCase
|
|||||||
->will($this->returnValue($requestContext))
|
->will($this->returnValue($requestContext))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$loader = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||||
$container
|
$container
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('has')
|
->method('has')
|
||||||
->with('router')
|
->with('router')
|
||||||
->will($this->returnValue(true))
|
->will($this->returnValue(true));
|
||||||
;
|
$container->method('get')
|
||||||
$container
|
->will($this->returnValueMap(array(
|
||||||
->expects($this->atLeastOnce())
|
array('router', 1, $router),
|
||||||
->method('get')
|
array('controller_name_converter', 1, $loader),
|
||||||
->with('router')
|
|
||||||
->will($this->returnValue($router))
|
)));
|
||||||
;
|
|
||||||
|
|
||||||
return $container;
|
return $container;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user