Code Duplication    Length = 38-38 lines in 2 locations

Tests/Generator/ClassGeneratorTest.php 2 locations

@@ 457-494 (lines=38) @@
454
        $this->compareFileGenerated($resourcesDir, $namespace, $className, $gClassgen);
455
    }
456
457
    public function testImplementsClassWithNamespaceAndFieldGeneratorMethodWithDependencyAutoInizializeClassWithGetterAndSetterAllStatic()
458
    {
459
        $namespace = 'TestNamespace';
460
        $className = 'ICWNAFWDACGSAS';
461
        $gClassgen = new ClassGenerator($namespace, $className);
462
        $gClassgen->setLogger($this->logger);
463
        $config = new ClassConfig();
464
        $config->haveConstructor = true;
465
        $config->haveGetter = true;
466
        $config->haveSetter = true;
467
        $properties = [
468
            'extend' => 'ExtendClass',
469
            'implements' => "NS\IClass",
470
            'fields' => [
471
            'prova' => [
472
                'primitive' => 'int',
473
                'description' => 'session unique identifier',
474
                'static' => true,
475
            ],
476
            'dependency' => [
477
                'class' => 'ClassDep',
478
                'autoinizialize' => true,
479
                'default' => 'new ClassDep()',
480
                'static' => true,
481
            ],
482
            ],
483
        ];
484
        $typesReferenceArray = [
485
            'ClassDep' => 'NamespaceDep',
486
        ];
487
        $typesDescArray = [
488
            'ClassDep' => 'comment ClassDep',
489
        ];
490
        $gClassgen->generateClassType($properties, $typesReferenceArray, $typesDescArray, $config);
491
        $resourcesDir = __DIR__.'/../Resources/php';
492
493
        $this->compareFileGenerated($resourcesDir, $namespace, $className, $gClassgen);
494
    }
495
496
    public function testSameNamespaceClassDependency()
497
    {
@@ 496-533 (lines=38) @@
493
        $this->compareFileGenerated($resourcesDir, $namespace, $className, $gClassgen);
494
    }
495
496
    public function testSameNamespaceClassDependency()
497
    {
498
        $namespace = 'TestNamespace';
499
        $className = 'SNCD';
500
        $gClassgen = new ClassGenerator($namespace, $className);
501
        $gClassgen->setLogger($this->logger);
502
        $config = new ClassConfig();
503
        $config->haveConstructor = true;
504
        $config->haveGetter = true;
505
        $config->haveSetter = true;
506
        $properties = [
507
            'extend' => 'ExtendClass',
508
            'implements' => "NS\IClass",
509
            'fields' => [
510
            'prova' => [
511
                'primitive' => 'int',
512
                'autoinizialize' => true,
513
                'default' => 0,
514
                'description' => 'session unique identifier',
515
            ],
516
            'dependency' => [
517
                'class' => 'ClassDep',
518
                'autoinizialize' => true,
519
                'default' => 'new ClassDep()',
520
            ],
521
            ],
522
        ];
523
        $typesReferenceArray = [
524
            'ClassDep' => 'TestNamespace',
525
        ];
526
        $typesDescArray = [
527
            'ClassDep' => 'comment ClassDep',
528
        ];
529
        $gClassgen->generateClassType($properties, $typesReferenceArray, $typesDescArray, $config);
530
        $resourcesDir = __DIR__.'/../Resources/php';
531
532
        $this->compareFileGenerated($resourcesDir, $namespace, $className, $gClassgen);
533
    }
534
535
    public function testEnum()
536
    {