22
33namespace Http \HttplugBundle \Tests \Unit \DependencyInjection ;
44
5- use Http \Client \Common \Plugin \Cache \Listener \CacheListener ;
65use Http \HttplugBundle \DependencyInjection \Configuration ;
76use Http \HttplugBundle \DependencyInjection \HttplugExtension ;
87use Matthias \SymfonyDependencyInjectionTest \PhpUnit \AbstractExtensionConfigurationTestCase ;
@@ -97,7 +96,7 @@ protected function getConfiguration(): ConfigurationInterface
9796 public function testEmptyConfiguration (): void
9897 {
9998 $ formats = array_map (function ($ path ) {
100- return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
99+ return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
101100 }, [
102101 'config/empty.yml ' ,
103102 'config/empty.xml ' ,
@@ -278,7 +277,7 @@ public function testSupportsAllConfigFormats(): void
278277 ];
279278
280279 $ formats = array_map (function ($ path ) {
281- return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
280+ return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
282281 }, [
283282 'config/full.yml ' ,
284283 'config/full.xml ' ,
@@ -292,7 +291,7 @@ public function testSupportsAllConfigFormats(): void
292291
293292 public function testMissingClass (): void
294293 {
295- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_class.yml ' ;
294+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_class.yml ' ;
296295
297296 $ this ->expectException (InvalidConfigurationException::class);
298297 $ this ->expectExceptionMessage ('Nonexisting\Class ' );
@@ -301,7 +300,7 @@ public function testMissingClass(): void
301300
302301 public function testInvalidPlugin (): void
303302 {
304- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_plugin.yml ' ;
303+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_plugin.yml ' ;
305304
306305 $ this ->expectException (InvalidConfigurationException::class);
307306 $ this ->expectExceptionMessage ('Unrecognized option "foobar" under "httplug.clients.acme.plugins.0" ' );
@@ -310,7 +309,7 @@ public function testInvalidPlugin(): void
310309
311310 public function testInvalidAuthentication (): void
312311 {
313- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_auth.yml ' ;
312+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_auth.yml ' ;
314313
315314 $ this ->expectException (InvalidConfigurationException::class);
316315 $ this ->expectExceptionMessage ('password, service, username ' );
@@ -322,7 +321,7 @@ public function testInvalidAuthentication(): void
322321 */
323322 public function testInvalidCacheConfig (): void
324323 {
325- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_cache_config.yml ' ;
324+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_cache_config.yml ' ;
326325
327326 $ this ->expectException (InvalidConfigurationException::class);
328327 $ 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
335334 public function testBackwardCompatibility (): void
336335 {
337336 $ formats = array_map (function ($ path ) {
338- return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
337+ return __DIR__ . '/../../Resources/Fixtures/ ' . $ path ;
339338 }, [
340339 'config/bc/toolbar.yml ' ,
341340 'config/bc/toolbar_auto.yml ' ,
@@ -351,7 +350,7 @@ public function testBackwardCompatibility(): void
351350 */
352351 public function testCacheConfigDeprecationCompatibility (): void
353352 {
354- $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/cache_config.yml ' ;
353+ $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/cache_config.yml ' ;
355354 $ config = $ this ->emptyConfig ;
356355 $ config ['plugins ' ]['cache ' ] = array_merge ($ config ['plugins ' ]['cache ' ], [
357356 'enabled ' => true ,
@@ -370,7 +369,7 @@ public function testCacheConfigDeprecationCompatibility(): void
370369 */
371370 public function testCacheConfigDeprecationCompatibilityIssue166 (): void
372371 {
373- $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/issue-166.yml ' ;
372+ $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/issue-166.yml ' ;
374373 $ config = $ this ->emptyConfig ;
375374 $ config ['plugins ' ]['cache ' ] = array_merge ($ config ['plugins ' ]['cache ' ], [
376375 'enabled ' => true ,
@@ -386,7 +385,7 @@ public function testCacheConfigDeprecationCompatibilityIssue166(): void
386385
387386 public function testProfilingToolbarCollision (): void
388387 {
389- $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/profiling_toolbar.yml ' ;
388+ $ file = __DIR__ . '/../../Resources/Fixtures/config/bc/profiling_toolbar.yml ' ;
390389
391390 $ this ->expectException (InvalidConfigurationException::class);
392391 $ 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
395394
396395 public function testClientCacheConfigMustHavePool (): void
397396 {
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 ' ;
399398
400399 $ this ->expectException (InvalidConfigurationException::class);
401400 $ 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
404403
405404 public function testCacheConfigMustHavePool (): void
406405 {
407- $ file = __DIR__ . '/../../Resources/Fixtures/config/cache_config_with_no_pool.yml ' ;
406+ $ file = __DIR__ . '/../../Resources/Fixtures/config/cache_config_with_no_pool.yml ' ;
408407
409408 $ this ->expectException (InvalidConfigurationException::class);
410409 $ this ->expectExceptionMessage ('The child node "cache_pool" at path "httplug.plugins.cache" must be configured. ' );
@@ -413,28 +412,18 @@ public function testCacheConfigMustHavePool(): void
413412
414413 public function testLimitlessCapturedBodyLength (): void
415414 {
416- $ file = __DIR__ . '/../../Resources/Fixtures/config/limitless_captured_body_length.yml ' ;
415+ $ file = __DIR__ . '/../../Resources/Fixtures/config/limitless_captured_body_length.yml ' ;
417416 $ config = $ this ->emptyConfig ;
418417 $ config ['profiling ' ]['captured_body_length ' ] = null ;
419418 $ this ->assertProcessedConfigurationEquals ($ config , [$ file ]);
420419 }
421420
422421 public function testInvalidCapturedBodyLengthString (): void
423422 {
424- $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_captured_body_length.yml ' ;
423+ $ file = __DIR__ . '/../../Resources/Fixtures/config/invalid_captured_body_length.yml ' ;
425424
426425 $ this ->expectException (InvalidConfigurationException::class);
427426 $ this ->expectExceptionMessage ('The child node "captured_body_length" at path "httplug.profiling" must be an integer or null ' );
428427 $ this ->assertProcessedConfigurationEquals ([], [$ file ]);
429428 }
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- }
440429}
0 commit comments