public function KernelTest::testTerminateDelegatesTerminationOnlyForTerminableInterface in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Tests/KernelTest.php \Symfony\Component\HttpKernel\Tests\KernelTest::testTerminateDelegatesTerminationOnlyForTerminableInterface()
File
- vendor/
symfony/ http-kernel/ Tests/ KernelTest.php, line 730
Class
Namespace
Symfony\Component\HttpKernel\TestsCode
public function testTerminateDelegatesTerminationOnlyForTerminableInterface() {
// does not implement TerminableInterface
$httpKernelMock = $this
->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')
->disableOriginalConstructor()
->getMock();
$httpKernelMock
->expects($this
->never())
->method('terminate');
$kernel = $this
->getKernel(array(
'getHttpKernel',
));
$kernel
->expects($this
->once())
->method('getHttpKernel')
->will($this
->returnValue($httpKernelMock));
$kernel
->boot();
$kernel
->terminate(Request::create('/'), new Response());
// implements TerminableInterface
$httpKernelMock = $this
->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernel')
->disableOriginalConstructor()
->setMethods(array(
'terminate',
))
->getMock();
$httpKernelMock
->expects($this
->once())
->method('terminate');
$kernel = $this
->getKernel(array(
'getHttpKernel',
));
$kernel
->expects($this
->exactly(2))
->method('getHttpKernel')
->will($this
->returnValue($httpKernelMock));
$kernel
->boot();
$kernel
->terminate(Request::create('/'), new Response());
}