use ExpectDeprecationTrait;
public function testTerminateDelegatesTerminationOnlyForTerminableInterface() { $storeMock =
$this->
getMockBuilder(StoreInterface::
class) ->
disableOriginalConstructor() ->
getMock();
// does not implement TerminableInterface
$kernel =
new TestKernel();
$httpCache =
new HttpCache($kernel,
$storeMock, null,
['terminate_on_cache_hit' => false
]);
$httpCache->
terminate(Request::
create('/'
),
new Response());
$this->
assertFalse($kernel->terminateCalled, 'terminate() is never called if the kernel class does not implement TerminableInterface'
);
// implements TerminableInterface
$kernelMock =
$this->
getMockBuilder(Kernel::
class) ->
disableOriginalConstructor() ->
onlyMethods(['terminate', 'registerBundles', 'registerContainerConfiguration'
]) ->
getMock();
$kernelMock->
expects($this->
once())