@@ -83,7 +83,7 @@ public function tearDown() {
83
83
if (!headers_sent ()) {
84
84
header ('Content-type: text/html ' ); //reset content type.
85
85
}
86
- call_user_func_array ('Cake\Routing\Router::setExtensions ' , [$ this ->_extensions , false ]);
86
+ call_user_func_array ('Cake\Routing\Router::parseExtensions ' , [$ this ->_extensions , false ]);
87
87
}
88
88
89
89
/**
@@ -122,7 +122,7 @@ public function testInitializeCallback() {
122
122
public function testInitializeContentTypeSettingExt () {
123
123
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
124
124
$ _SERVER ['HTTP_ACCEPT ' ] = 'application/json ' ;
125
- Router::setExtensions ('json ' , false );
125
+ Router::parseExtensions ('json ' , false );
126
126
127
127
$ this ->assertNull ($ this ->RequestHandler ->ext );
128
128
@@ -139,7 +139,7 @@ public function testInitializeContentTypeWithjQueryAccept() {
139
139
$ _SERVER ['HTTP_ACCEPT ' ] = 'application/json, application/javascript, */*; q=0.01 ' ;
140
140
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
141
141
$ this ->assertNull ($ this ->RequestHandler ->ext );
142
- Router::setExtensions ('json ' , false );
142
+ Router::parseExtensions ('json ' , false );
143
143
144
144
$ this ->RequestHandler ->initialize ($ event );
145
145
$ this ->assertEquals ('json ' , $ this ->RequestHandler ->ext );
@@ -154,7 +154,7 @@ public function testInitializeContentTypeWithjQueryTextPlainAccept() {
154
154
$ _SERVER ['HTTP_ACCEPT ' ] = 'text/plain, */*; q=0.01 ' ;
155
155
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
156
156
$ this ->assertNull ($ this ->RequestHandler ->ext );
157
- Router::setExtensions ('csv ' , false );
157
+ Router::parseExtensions ('csv ' , false );
158
158
159
159
$ this ->RequestHandler ->initialize ($ event );
160
160
$ this ->assertNull ($ this ->RequestHandler ->ext );
@@ -170,7 +170,7 @@ public function testInitializeContentTypeWithjQueryAcceptAndMultiplesExtensions(
170
170
$ _SERVER ['HTTP_ACCEPT ' ] = 'application/json, application/javascript, */*; q=0.01 ' ;
171
171
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
172
172
$ this ->assertNull ($ this ->RequestHandler ->ext );
173
- Router::setExtensions (['rss ' , 'json ' ], false );
173
+ Router::parseExtensions (['rss ' , 'json ' ], false );
174
174
175
175
$ this ->RequestHandler ->initialize ($ event );
176
176
$ this ->assertEquals ('json ' , $ this ->RequestHandler ->ext );
@@ -185,7 +185,7 @@ public function testInitializeNoContentTypeWithSingleAccept() {
185
185
$ _SERVER ['HTTP_ACCEPT ' ] = 'application/json, text/html, */*; q=0.01 ' ;
186
186
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
187
187
$ this ->assertNull ($ this ->RequestHandler ->ext );
188
- Router::setExtensions ('json ' , false );
188
+ Router::parseExtensions ('json ' , false );
189
189
190
190
$ this ->RequestHandler ->initialize ($ event );
191
191
$ this ->assertNull ($ this ->RequestHandler ->ext );
@@ -203,13 +203,13 @@ public function testInitializeNoContentTypeWithMultipleAcceptedTypes() {
203
203
$ _SERVER ['HTTP_ACCEPT ' ] = 'application/json, application/javascript, application/xml, */*; q=0.01 ' ;
204
204
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
205
205
$ this ->assertNull ($ this ->RequestHandler ->ext );
206
- Router::setExtensions (['xml ' , 'json ' ], false );
206
+ Router::parseExtensions (['xml ' , 'json ' ], false );
207
207
208
208
$ this ->RequestHandler ->initialize ($ event );
209
209
$ this ->assertEquals ('xml ' , $ this ->RequestHandler ->ext );
210
210
211
211
$ this ->RequestHandler ->ext = null ;
212
- Router::setExtensions (array ('json ' , 'xml ' ), false );
212
+ Router::parseExtensions (array ('json ' , 'xml ' ), false );
213
213
214
214
$ this ->RequestHandler ->initialize ($ event );
215
215
$ this ->assertEquals ('json ' , $ this ->RequestHandler ->ext );
@@ -224,7 +224,7 @@ public function testInitializeContentTypeWithMultipleAcceptedTypes() {
224
224
$ _SERVER ['HTTP_ACCEPT ' ] = 'text/csv;q=1.0, application/json;q=0.8, application/xml;q=0.7 ' ;
225
225
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
226
226
$ this ->assertNull ($ this ->RequestHandler ->ext );
227
- Router::setExtensions (['xml ' , 'json ' ], false );
227
+ Router::parseExtensions (['xml ' , 'json ' ], false );
228
228
229
229
$ this ->RequestHandler ->initialize ($ event );
230
230
$ this ->assertEquals ('json ' , $ this ->RequestHandler ->ext );
@@ -239,7 +239,7 @@ public function testInitializeAmbiguousAndroidAccepts() {
239
239
$ _SERVER ['HTTP_ACCEPT ' ] = 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 ' ;
240
240
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
241
241
$ this ->assertNull ($ this ->RequestHandler ->ext );
242
- Router::setExtensions (['html ' , 'xml ' ], false );
242
+ Router::parseExtensions (['html ' , 'xml ' ], false );
243
243
244
244
$ this ->RequestHandler ->initialize ($ event );
245
245
$ this ->assertNull ($ this ->RequestHandler ->ext );
@@ -252,7 +252,7 @@ public function testInitializeAmbiguousAndroidAccepts() {
252
252
*/
253
253
public function testInititalizeFirefoxHeaderNotXml () {
254
254
$ _SERVER ['HTTP_ACCEPT ' ] = 'text/html,application/xhtml+xml,application/xml;image/png,image/jpeg,image/*;q=0.9,*/*;q=0.8 ' ;
255
- Router::setExtensions (['xml ' , 'json ' ], false );
255
+ Router::parseExtensions (['xml ' , 'json ' ], false );
256
256
257
257
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
258
258
$ this ->RequestHandler ->initialize ($ event );
@@ -268,7 +268,7 @@ public function testInitializeContentTypeAndExtensionMismatch() {
268
268
$ event = new Event ('Controller.initialize ' , $ this ->Controller );
269
269
$ this ->assertNull ($ this ->RequestHandler ->ext );
270
270
$ extensions = Router::extensions ();
271
- Router::setExtensions ('xml ' , false );
271
+ Router::parseExtensions ('xml ' , false );
272
272
273
273
$ this ->Controller ->request = $ this ->getMock ('Cake\Network\Request ' , ['accepts ' ]);
274
274
$ this ->Controller ->request ->expects ($ this ->any ())
@@ -278,7 +278,7 @@ public function testInitializeContentTypeAndExtensionMismatch() {
278
278
$ this ->RequestHandler ->initialize ($ event );
279
279
$ this ->assertNull ($ this ->RequestHandler ->ext );
280
280
281
- call_user_func_array (array ('Cake\Routing\Router ' , 'setExtensions ' ), [$ extensions , false ]);
281
+ call_user_func_array (array ('Cake\Routing\Router ' , 'parseExtensions ' ), [$ extensions , false ]);
282
282
}
283
283
284
284
/**
@@ -353,7 +353,7 @@ public function testAutoAjaxLayout() {
353
353
* test custom JsonView class is loaded and correct.
354
354
*/
355
355
public function testJsonViewLoaded () {
356
- Router::setExtensions (['json ' , 'xml ' , 'ajax ' ], false );
356
+ Router::parseExtensions (['json ' , 'xml ' , 'ajax ' ], false );
357
357
$ this ->Controller ->request ->params ['_ext ' ] = 'json ' ;
358
358
$ event = new Event ('Controller.startup ' , $ this ->Controller );
359
359
$ this ->RequestHandler ->initialize ($ event );
@@ -368,7 +368,7 @@ public function testJsonViewLoaded() {
368
368
* test custom XmlView class is loaded and correct.
369
369
*/
370
370
public function testXmlViewLoaded () {
371
- Router::setExtensions (['json ' , 'xml ' , 'ajax ' ], false );
371
+ Router::parseExtensions (['json ' , 'xml ' , 'ajax ' ], false );
372
372
$ this ->Controller ->request ->params ['_ext ' ] = 'xml ' ;
373
373
$ event = new Event ('Controller.startup ' , $ this ->Controller );
374
374
$ this ->RequestHandler ->initialize ($ event );
@@ -383,7 +383,7 @@ public function testXmlViewLoaded() {
383
383
* test custom AjaxView class is loaded and correct.
384
384
*/
385
385
public function testAjaxViewLoaded () {
386
- Router::setExtensions (['json ' , 'xml ' , 'ajax ' ], false );
386
+ Router::parseExtensions (['json ' , 'xml ' , 'ajax ' ], false );
387
387
$ this ->Controller ->request ->params ['_ext ' ] = 'ajax ' ;
388
388
$ event = new Event ('Controller.startup ' , $ this ->Controller );
389
389
$ this ->RequestHandler ->initialize ($ event );
@@ -397,7 +397,7 @@ public function testAjaxViewLoaded() {
397
397
* test configured extension but no view class set.
398
398
*/
399
399
public function testNoViewClassExtension () {
400
- Router::setExtensions (['json ' , 'xml ' , 'ajax ' , 'csv ' ], false );
400
+ Router::parseExtensions (['json ' , 'xml ' , 'ajax ' , 'csv ' ], false );
401
401
$ this ->Controller ->request ->params ['_ext ' ] = 'csv ' ;
402
402
$ event = new Event ('Controller.startup ' , $ this ->Controller );
403
403
$ this ->RequestHandler ->initialize ($ event );
0 commit comments