File tree Expand file tree Collapse file tree 5 files changed +49
-4
lines changed
Resources/Fixtures/config Expand file tree Collapse file tree 5 files changed +49
-4
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,13 @@ public function getConfigTreeBuilder()
5252
5353 $ rootNode
5454 ->validate ()
55- ->ifTrue (function ($ v ) {return $ v ['cache_manager ' ]['enabled ' ] && !isset ($ v ['proxy_client ' ]);})
55+ ->ifTrue (function ($ v ) {
56+ return $ v ['cache_manager ' ]['enabled ' ]
57+ && !isset ($ v ['proxy_client ' ])
58+ && !isset ($ v ['cache_manager ' ]['custom_proxy_client ' ])
59+ ;
60+ })
5661 ->then (function ($ v ) {
57- if (!empty ($ v ['cache_manager ' ]['proxy_client ' ])) {
58- return $ v ;
59- }
6062 if ('auto ' === $ v ['cache_manager ' ]['enabled ' ]) {
6163 $ v ['cache_manager ' ]['enabled ' ] = false ;
6264
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ container ->loadFromExtension ('fos_http_cache ' , array (
4+ 'cache_manager ' => array (
5+ 'enabled ' => true ,
6+ 'custom_proxy_client ' => 'acme.proxy_client ' ,
7+ ),
8+ ));
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <container xmlns =" http://symfony.com/schema/dic/services" >
3+
4+ <config xmlns =" http://example.org/schema/dic/fos_http_cache" >
5+ <cache-manager enabled =" true" custom-proxy-client =" acme.proxy_client" />
6+ </config >
7+ </container >
Original file line number Diff line number Diff line change 1+ fos_http_cache :
2+ cache_manager :
3+ enabled : true
4+ custom_proxy_client : acme.proxy_client
Original file line number Diff line number Diff line change @@ -184,6 +184,30 @@ public function testSupportsAllConfigFormats()
184184 }
185185 }
186186
187+ public function testCustomProxyClient ()
188+ {
189+ $ expectedConfiguration = $ this ->getEmptyConfig ();
190+ $ expectedConfiguration ['cache_manager ' ] = array (
191+ 'enabled ' => true ,
192+ 'custom_proxy_client ' => 'acme.proxy_client ' ,
193+ 'generate_url_type ' => 'auto ' ,
194+ );
195+ $ expectedConfiguration ['tags ' ]['enabled ' ] = 'auto ' ;
196+ $ expectedConfiguration ['invalidation ' ]['enabled ' ] = 'auto ' ;
197+
198+ $ formats = array_map (function ($ path ) {
199+ return __DIR__ .'/../../Resources/Fixtures/ ' .$ path ;
200+ }, array (
201+ 'config/custom-client.yml ' ,
202+ 'config/custom-client.xml ' ,
203+ 'config/custom-client.php ' ,
204+ ));
205+
206+ foreach ($ formats as $ format ) {
207+ $ this ->assertProcessedConfigurationEquals ($ expectedConfiguration , array ($ format ));
208+ }
209+ }
210+
187211 public function testSupportsNginx ()
188212 {
189213 $ expectedConfiguration = $ this ->getEmptyConfig ();
You can’t perform that action at this time.
0 commit comments