[HttpKernel] Fixed ContainerAwareHttpKernelTest.
This commit is contained in:
parent
af4c9d6626
commit
d5e7bdf5ee
@ -53,14 +53,23 @@ class ContainerAwareHttpKernelTest extends \PHPUnit_Framework_TestCase
|
||||
->method('leaveScope')
|
||||
->with($this->equalTo('request'))
|
||||
;
|
||||
// first call is for addScope()
|
||||
$container
|
||||
->expects($this->at(2))
|
||||
->expects($this->at(0))
|
||||
->method('hasScope')
|
||||
->with($this->equalTo('request'))
|
||||
->will($this->returnValue(false));
|
||||
$container
|
||||
->expects($this->at(1))
|
||||
->method('addScope')
|
||||
->with($this->isInstanceOf('Symfony\Component\DependencyInjection\Scope'));
|
||||
// enterScope()
|
||||
$container
|
||||
->expects($this->at(3))
|
||||
->method('set')
|
||||
->with($this->equalTo('request'), $this->equalTo($request), $this->equalTo('request'))
|
||||
;
|
||||
$container
|
||||
->expects($this->at(3))
|
||||
->expects($this->at(4))
|
||||
->method('set')
|
||||
->with($this->equalTo('request'), $this->equalTo(null), $this->equalTo('request'))
|
||||
;
|
||||
@ -106,6 +115,12 @@ class ContainerAwareHttpKernelTest extends \PHPUnit_Framework_TestCase
|
||||
->method('leaveScope')
|
||||
->with($this->equalTo('request'))
|
||||
;
|
||||
$container
|
||||
->expects($this->at(0))
|
||||
->method('hasScope')
|
||||
->with($this->equalTo('request'))
|
||||
->will($this->returnValue(true));
|
||||
// enterScope()
|
||||
$container
|
||||
->expects($this->at(2))
|
||||
->method('set')
|
||||
@ -137,6 +152,8 @@ class ContainerAwareHttpKernelTest extends \PHPUnit_Framework_TestCase
|
||||
try {
|
||||
$kernel->handle($request, $type);
|
||||
$this->fail('->handle() suppresses the controller exception');
|
||||
} catch (\PHPUnit_Framework_Exception $exception) {
|
||||
throw $exception;
|
||||
} catch (\Exception $actual) {
|
||||
$this->assertSame($expected, $actual, '->handle() throws the controller exception');
|
||||
}
|
||||
|
Reference in New Issue
Block a user