Code Duplication    Length = 18-19 lines in 4 locations

tests/Unit/DependencyInjection/HttplugExtensionTest.php 4 locations

@@ 381-398 (lines=18) @@
378
        $this->assertFalse($this->container->getDefinition('httplug.client.acme.batch_client')->isPublic());
379
    }
380
381
    public function testClientCanBePublic(): void
382
    {
383
        $this->load([
384
            'clients' => [
385
                'acme' => [
386
                    'public' => true,
387
                ],
388
            ],
389
        ]);
390
391
        $this->assertContainerBuilderHasService('httplug.client.acme');
392
        $this->assertTrue($this->container->getDefinition('httplug.client.acme')->isPublic());
393
394
        if (version_compare(Kernel::VERSION, '3.4', '>=')) {
395
            // Symfony made services private by default starting from 3.4
396
            $this->assertFalse($this->container->getDefinition('httplug.client.acme')->isPrivate());
397
        }
398
    }
399
400
    public function testFlexibleClientCanBePublic(): void
401
    {
@@ 400-418 (lines=19) @@
397
        }
398
    }
399
400
    public function testFlexibleClientCanBePublic(): void
401
    {
402
        $this->load([
403
            'clients' => [
404
                'acme' => [
405
                    'public' => true,
406
                    'flexible_client' => true,
407
                ],
408
            ],
409
        ]);
410
411
        $this->assertContainerBuilderHasService('httplug.client.acme');
412
        $this->assertTrue($this->container->getDefinition('httplug.client.acme.flexible')->isPublic());
413
414
        if (version_compare(Kernel::VERSION, '3.4', '>=')) {
415
            // Symfony made services private by default starting from 3.4
416
            $this->assertFalse($this->container->getDefinition('httplug.client.acme.flexible')->isPrivate());
417
        }
418
    }
419
420
    public function testHttpMethodsClientCanBePublic(): void
421
    {
@@ 420-438 (lines=19) @@
417
        }
418
    }
419
420
    public function testHttpMethodsClientCanBePublic(): void
421
    {
422
        $this->load([
423
            'clients' => [
424
                'acme' => [
425
                    'public' => true,
426
                    'http_methods_client' => true,
427
                ],
428
            ],
429
        ]);
430
431
        $this->assertContainerBuilderHasService('httplug.client.acme');
432
        $this->assertTrue($this->container->getDefinition('httplug.client.acme.http_methods')->isPublic());
433
434
        if (version_compare(Kernel::VERSION, '3.4', '>=')) {
435
            // Symfony made services private by default starting from 3.4
436
            $this->assertFalse($this->container->getDefinition('httplug.client.acme.http_methods')->isPrivate());
437
        }
438
    }
439
440
    public function testBatchClientCanBePublic(): void
441
    {
@@ 440-458 (lines=19) @@
437
        }
438
    }
439
440
    public function testBatchClientCanBePublic(): void
441
    {
442
        $this->load([
443
            'clients' => [
444
                'acme' => [
445
                    'public' => true,
446
                    'batch_client' => true,
447
                ],
448
            ],
449
        ]);
450
451
        $this->assertContainerBuilderHasService('httplug.client.acme');
452
        $this->assertTrue($this->container->getDefinition('httplug.client.acme.batch_client')->isPublic());
453
454
        if (version_compare(Kernel::VERSION, '3.4', '>=')) {
455
            // Symfony made services private by default starting from 3.4
456
            $this->assertFalse($this->container->getDefinition('httplug.client.acme.batch_client')->isPrivate());
457
        }
458
    }
459
460
    public function testClientIsTaggedWithHttplugClientTag(): void
461
    {