2
2
3
3
namespace Http \HttplugBundle \Tests \Unit \DependencyInjection ;
4
4
5
- use Http \Client \Common \Plugin \Cache \Listener \CacheListener ;
6
5
use Http \HttplugBundle \DependencyInjection \Configuration ;
7
6
use Http \HttplugBundle \DependencyInjection \HttplugExtension ;
8
7
use Matthias \SymfonyDependencyInjectionTest \PhpUnit \AbstractExtensionConfigurationTestCase ;
@@ -97,7 +96,7 @@ protected function getConfiguration(): ConfigurationInterface
97
96
public function testEmptyConfiguration (): void
98
97
{
99
98
$ formats = array_map (function ($ path ) {
100
- return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
99
+ return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
101
100
}, [
102
101
'config/empty.yml ' ,
103
102
'config/empty.xml ' ,
@@ -278,7 +277,7 @@ public function testSupportsAllConfigFormats(): void
278
277
];
279
278
280
279
$ formats = array_map (function ($ path ) {
281
- return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
280
+ return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
282
281
}, [
283
282
'config/full.yml ' ,
284
283
'config/full.xml ' ,
@@ -292,7 +291,7 @@ public function testSupportsAllConfigFormats(): void
292
291
293
292
public function testMissingClass (): void
294
293
{
295
- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_class.yml ' ;
294
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_class.yml ' ;
296
295
297
296
$ this ->expectException (InvalidConfigurationException::class);
298
297
$ this ->expectExceptionMessage ('Nonexisting\Class ' );
@@ -301,7 +300,7 @@ public function testMissingClass(): void
301
300
302
301
public function testInvalidPlugin (): void
303
302
{
304
- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_plugin.yml ' ;
303
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_plugin.yml ' ;
305
304
306
305
$ this ->expectException (InvalidConfigurationException::class);
307
306
$ this ->expectExceptionMessage ('Unrecognized option "foobar" under "httplug.clients.acme.plugins.0" ' );
@@ -310,7 +309,7 @@ public function testInvalidPlugin(): void
310
309
311
310
public function testInvalidAuthentication (): void
312
311
{
313
- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_auth.yml ' ;
312
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_auth.yml ' ;
314
313
315
314
$ this ->expectException (InvalidConfigurationException::class);
316
315
$ this ->expectExceptionMessage ('password, service, username ' );
@@ -322,7 +321,7 @@ public function testInvalidAuthentication(): void
322
321
*/
323
322
public function testInvalidCacheConfig (): void
324
323
{
325
- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_cache_config.yml ' ;
324
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_cache_config.yml ' ;
326
325
327
326
$ this ->expectException (InvalidConfigurationException::class);
328
327
$ this ->expectExceptionMessage ('Invalid configuration for path "httplug.plugins.cache.config": You can \'t provide config option "respect_cache_headers" and "respect_response_cache_directives" simultaniously. Use "respect_response_cache_directives" instead. ' );
@@ -335,7 +334,7 @@ public function testInvalidCacheConfig(): void
335
334
public function testBackwardCompatibility (): void
336
335
{
337
336
$ formats = array_map (function ($ path ) {
338
- return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
337
+ return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
339
338
}, [
340
339
'config/bc/toolbar.yml ' ,
341
340
'config/bc/toolbar_auto.yml ' ,
@@ -351,7 +350,7 @@ public function testBackwardCompatibility(): void
351
350
*/
352
351
public function testCacheConfigDeprecationCompatibility (): void
353
352
{
354
- $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/cache_config.yml ' ;
353
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/cache_config.yml ' ;
355
354
$ config = $ this ->emptyConfig ;
356
355
$ config ['plugins ' ]['cache ' ] = array_merge ($ config ['plugins ' ]['cache ' ], [
357
356
'enabled ' => true ,
@@ -370,7 +369,7 @@ public function testCacheConfigDeprecationCompatibility(): void
370
369
*/
371
370
public function testCacheConfigDeprecationCompatibilityIssue166 (): void
372
371
{
373
- $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/issue-166.yml ' ;
372
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/issue-166.yml ' ;
374
373
$ config = $ this ->emptyConfig ;
375
374
$ config ['plugins ' ]['cache ' ] = array_merge ($ config ['plugins ' ]['cache ' ], [
376
375
'enabled ' => true ,
@@ -386,7 +385,7 @@ public function testCacheConfigDeprecationCompatibilityIssue166(): void
386
385
387
386
public function testProfilingToolbarCollision (): void
388
387
{
389
- $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/profiling_toolbar.yml ' ;
388
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/profiling_toolbar.yml ' ;
390
389
391
390
$ this ->expectException (InvalidConfigurationException::class);
392
391
$ this ->expectExceptionMessage ('Can \'t configure both "toolbar" and "profiling" section. The "toolbar" config is deprecated as of version 1.3.0, please only use "profiling". ' );
@@ -395,7 +394,7 @@ public function testProfilingToolbarCollision(): void
395
394
396
395
public function testClientCacheConfigMustHavePool (): void
397
396
{
398
- $ file = __DIR__ . '/../../Resources/Fixtures/config/client_cache_config_with_no_pool.yml ' ;
397
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/client_cache_config_with_no_pool.yml ' ;
399
398
400
399
$ this ->expectException (InvalidConfigurationException::class);
401
400
$ this ->expectExceptionMessage ('The child node "cache_pool" at path "httplug.clients.test.plugins.0.cache" must be configured. ' );
@@ -404,7 +403,7 @@ public function testClientCacheConfigMustHavePool(): void
404
403
405
404
public function testCacheConfigMustHavePool (): void
406
405
{
407
- $ file = __DIR__ . '/../../Resources/Fixtures/config/cache_config_with_no_pool.yml ' ;
406
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/cache_config_with_no_pool.yml ' ;
408
407
409
408
$ this ->expectException (InvalidConfigurationException::class);
410
409
$ this ->expectExceptionMessage ('The child node "cache_pool" at path "httplug.plugins.cache" must be configured. ' );
@@ -413,28 +412,18 @@ public function testCacheConfigMustHavePool(): void
413
412
414
413
public function testLimitlessCapturedBodyLength (): void
415
414
{
416
- $ file = __DIR__ . '/../../Resources/Fixtures/config/limitless_captured_body_length.yml ' ;
415
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/limitless_captured_body_length.yml ' ;
417
416
$ config = $ this ->emptyConfig ;
418
417
$ config ['profiling ' ]['captured_body_length ' ] = null ;
419
418
$ this ->assertProcessedConfigurationEquals ($ config , [$ file ]);
420
419
}
421
420
422
421
public function testInvalidCapturedBodyLengthString (): void
423
422
{
424
- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_captured_body_length.yml ' ;
423
+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_captured_body_length.yml ' ;
425
424
426
425
$ this ->expectException (InvalidConfigurationException::class);
427
426
$ this ->expectExceptionMessage ('The child node "captured_body_length" at path "httplug.profiling" must be an integer or null ' );
428
427
$ this ->assertProcessedConfigurationEquals ([], [$ file ]);
429
428
}
430
-
431
- public function testInvalidCacheConfigCacheListeners (): void
432
- {
433
- $ file = __DIR__ .'/../../Resources/Fixtures/config/invalid_cache_listener_config.yml ' ;
434
-
435
- $ this ->expectException (InvalidConfigurationException::class);
436
- $ this ->expectExceptionMessage ('A given listener class does not implement ' .CacheListener::class);
437
-
438
- $ this ->assertProcessedConfigurationEquals ($ this ->emptyConfig , [$ file ]);
439
- }
440
429
}
0 commit comments