@@ -45,7 +45,10 @@ class ApiPlatformExtensionTest extends \PHPUnit_Framework_TestCase
45
45
'jsonld ' => ['mime_types ' => ['application/ld+json ' ]],
46
46
'jsonhal ' => ['mime_types ' => ['application/hal+json ' ]],
47
47
],
48
- 'http_cache ' => ['invalidation ' => ['enabled ' => true ]],
48
+ 'http_cache ' => ['invalidation ' => [
49
+ 'enabled ' => true ,
50
+ 'varnish_urls ' => ['test ' ],
51
+ ]],
49
52
]];
50
53
51
54
private $ extension ;
@@ -404,6 +407,7 @@ private function getContainerBuilderProphecy()
404
407
'api_platform.http_cache.purger.varnish ' ,
405
408
'api_platform.http_cache.purger.varnish_client ' ,
406
409
'api_platform.http_cache.listener.response.add_tags ' ,
410
+ 'api_platform.http_cache.purger.varnish_client.test '
407
411
];
408
412
409
413
foreach ($ definitions as $ definition ) {
@@ -426,6 +430,7 @@ private function getContainerBuilderProphecy()
426
430
'api_platform.property_accessor ' => 'property_accessor ' ,
427
431
'api_platform.property_info ' => 'property_info ' ,
428
432
'api_platform.serializer ' => 'serializer ' ,
433
+ 'api_platform.http_cache.purger ' => 'api_platform.http_cache.purger.varnish ' ,
429
434
];
430
435
431
436
foreach ($ aliases as $ alias => $ service ) {
@@ -434,6 +439,7 @@ private function getContainerBuilderProphecy()
434
439
435
440
$ containerBuilderProphecy ->getParameter ('kernel.debug ' )->willReturn (false );
436
441
$ containerBuilderProphecy ->getParameter ('api_platform.api_resources_directory ' )->willReturn ('Entity ' );
442
+ $ containerBuilderProphecy ->getDefinition ('api_platform.http_cache.purger.varnish ' )->willReturn (new Definition ());
437
443
438
444
return $ containerBuilderProphecy ;
439
445
}
0 commit comments