File tree 5 files changed +49
-4
lines changed
Resources/Fixtures/config
5 files changed +49
-4
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,13 @@ public function getConfigTreeBuilder()
52
52
53
53
$ rootNode
54
54
->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
+ })
56
61
->then (function ($ v ) {
57
- if (!empty ($ v ['cache_manager ' ]['proxy_client ' ])) {
58
- return $ v ;
59
- }
60
62
if ('auto ' === $ v ['cache_manager ' ]['enabled ' ]) {
61
63
$ v ['cache_manager ' ]['enabled ' ] = false ;
62
64
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()
184
184
}
185
185
}
186
186
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
+
187
211
public function testSupportsNginx ()
188
212
{
189
213
$ expectedConfiguration = $ this ->getEmptyConfig ();
You can’t perform that action at this time.
0 commit comments