Code Duplication    Length = 8-8 lines in 8 locations

tests/Unit/DependencyInjection/ConfigurationTest.php 8 locations

@@ 332-339 (lines=8) @@
329
        }
330
    }
331
332
    public function testMissingClass(): void
333
    {
334
        $file = __DIR__.'/../../Resources/Fixtures/config/invalid_class.yml';
335
336
        $this->expectException(InvalidConfigurationException::class);
337
        $this->expectExceptionMessage('Nonexisting\Class');
338
        $this->assertProcessedConfigurationEquals([], [$file]);
339
    }
340
341
    public function testInvalidPlugin(): void
342
    {
@@ 341-348 (lines=8) @@
338
        $this->assertProcessedConfigurationEquals([], [$file]);
339
    }
340
341
    public function testInvalidPlugin(): void
342
    {
343
        $file = __DIR__.'/../../Resources/Fixtures/config/invalid_plugin.yml';
344
345
        $this->expectException(InvalidConfigurationException::class);
346
        $this->expectExceptionMessage('Unrecognized option "foobar" under "httplug.clients.acme.plugins.0"');
347
        $this->assertProcessedConfigurationEquals([], [$file]);
348
    }
349
350
    public function testInvalidAuthentication(): void
351
    {
@@ 350-357 (lines=8) @@
347
        $this->assertProcessedConfigurationEquals([], [$file]);
348
    }
349
350
    public function testInvalidAuthentication(): void
351
    {
352
        $file = __DIR__.'/../../Resources/Fixtures/config/invalid_auth.yml';
353
354
        $this->expectException(InvalidConfigurationException::class);
355
        $this->expectExceptionMessage('password, service, username');
356
        $this->assertProcessedConfigurationEquals([], [$file]);
357
    }
358
359
    /**
360
     * @group legacy
@@ 362-369 (lines=8) @@
359
    /**
360
     * @group legacy
361
     */
362
    public function testInvalidCacheConfig(): void
363
    {
364
        $file = __DIR__.'/../../Resources/Fixtures/config/invalid_cache_config.yml';
365
366
        $this->expectException(InvalidConfigurationException::class);
367
        $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.');
368
        $this->assertProcessedConfigurationEquals([], [$file]);
369
    }
370
371
    /**
372
     * @group legacy
@@ 428-435 (lines=8) @@
425
        $this->assertProcessedConfigurationEquals($config, [$file]);
426
    }
427
428
    public function testProfilingToolbarCollision(): void
429
    {
430
        $file = __DIR__.'/../../Resources/Fixtures/config/bc/profiling_toolbar.yml';
431
432
        $this->expectException(InvalidConfigurationException::class);
433
        $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".');
434
        $this->assertProcessedConfigurationEquals([], [$file]);
435
    }
436
437
    public function testClientCacheConfigMustHavePool(): void
438
    {
@@ 437-444 (lines=8) @@
434
        $this->assertProcessedConfigurationEquals([], [$file]);
435
    }
436
437
    public function testClientCacheConfigMustHavePool(): void
438
    {
439
        $file = __DIR__.'/../../Resources/Fixtures/config/client_cache_config_with_no_pool.yml';
440
441
        $this->expectException(InvalidConfigurationException::class);
442
        $this->expectExceptionMessage('httplug.clients.test.plugins.0.cache');
443
        $this->assertProcessedConfigurationEquals([], [$file]);
444
    }
445
446
    public function testCacheConfigMustHavePool(): void
447
    {
@@ 446-453 (lines=8) @@
443
        $this->assertProcessedConfigurationEquals([], [$file]);
444
    }
445
446
    public function testCacheConfigMustHavePool(): void
447
    {
448
        $file = __DIR__.'/../../Resources/Fixtures/config/cache_config_with_no_pool.yml';
449
450
        $this->expectException(InvalidConfigurationException::class);
451
        $this->expectExceptionMessage('cache_pool');
452
        $this->assertProcessedConfigurationEquals([], [$file]);
453
    }
454
455
    public function testLimitlessCapturedBodyLength(): void
456
    {
@@ 463-470 (lines=8) @@
460
        $this->assertProcessedConfigurationEquals($config, [$file]);
461
    }
462
463
    public function testInvalidCapturedBodyLengthString(): void
464
    {
465
        $file = __DIR__.'/../../Resources/Fixtures/config/invalid_captured_body_length.yml';
466
467
        $this->expectException(InvalidConfigurationException::class);
468
        $this->expectExceptionMessage('The child node "captured_body_length" at path "httplug.profiling" must be an integer or null');
469
        $this->assertProcessedConfigurationEquals([], [$file]);
470
    }
471
}
472