@@ -58,7 +58,7 @@ public function testSupportsAllConfigFormats()
5858 'ips ' => array ('1.2.3.4 ' , '1.1.1.1 ' ),
5959 'attributes ' => array ('_controller ' => 'fos.user_bundle.* ' ),
6060 'additional_cacheable_status ' => array (100 , 500 ),
61- 'match_response ' => array () ,
61+ 'match_response ' => '' ,
6262 // TODO 'match_response' => '',
6363 ),
6464 'headers ' => array (
@@ -103,7 +103,7 @@ public function testSupportsAllConfigFormats()
103103 '_foo ' => 'bar ' ,
104104 ),
105105 'additional_cacheable_status ' => array (501 , 502 ),
106- 'match_response ' => array () ,
106+ 'match_response ' => '' ,
107107 // TODO match_response
108108 ),
109109 'tags ' => array ('a ' , 'b ' ),
@@ -124,7 +124,7 @@ public function testSupportsAllConfigFormats()
124124 '_format ' => 'json ' ,
125125 ),
126126 'additional_cacheable_status ' => array (404 , 403 ),
127- 'match_response ' => array () ,
127+ 'match_response ' => '' ,
128128 // TODO match_response
129129 ),
130130 'routes ' => array (
@@ -202,6 +202,57 @@ public function testSupportsNginx()
202202 }
203203 }
204204
205+ public function testSplitOptions ()
206+ {
207+ $ expectedConfiguration = $ this ->getEmptyConfig ();
208+ $ expectedConfiguration ['cache_control ' ] = array (
209+ 'rules ' => array (
210+ array (
211+ 'match ' => array (
212+ 'path ' => null ,
213+ 'host ' => null ,
214+ 'attributes ' => array (),
215+ 'additional_cacheable_status ' => array (),
216+ 'match_response ' => null ,
217+ 'methods ' => array ('GET ' , 'POST ' ),
218+ 'ips ' => array ('1.2.3.4 ' , '1.1.1.1 ' ),
219+ ),
220+ 'headers ' => array (
221+ 'reverse_proxy_ttl ' => null ,
222+ 'vary ' => array ('Cookie ' , 'Authorization ' ),
223+ ),
224+ ),
225+ ),
226+ );
227+ $ expectedConfiguration ['proxy_client ' ] = array (
228+ 'varnish ' => array (
229+ 'base_url ' => null ,
230+ 'guzzle_client ' => null ,
231+ 'servers ' => array ('1.1.1.1:80 ' , '2.2.2.2:80 ' ),
232+ ),
233+ 'nginx ' => array (
234+ 'base_url ' => null ,
235+ 'guzzle_client ' => null ,
236+ 'purge_location ' => '' ,
237+ 'servers ' => array ('1.1.1.1:81 ' , '2.2.2.2:81 ' ),
238+ ),
239+ );
240+ $ expectedConfiguration ['cache_manager ' ]['enabled ' ] = 'auto ' ;
241+ $ expectedConfiguration ['tags ' ]['enabled ' ] = 'auto ' ;
242+ $ expectedConfiguration ['invalidation ' ]['enabled ' ] = 'auto ' ;
243+
244+ $ formats = array_map (function ($ path ) {
245+ return __DIR__ .'/../../Resources/Fixtures/ ' .$ path ;
246+ }, array (
247+ 'config/split.yml ' ,
248+ 'config/split.xml ' ,
249+ 'config/split.php ' ,
250+ ));
251+
252+ foreach ($ formats as $ format ) {
253+ $ this ->assertProcessedConfigurationEquals ($ expectedConfiguration , array ($ format ));
254+ }
255+ }
205256
206257 public function testCacheManagerNoClient ()
207258 {
0 commit comments