Code Duplication    Length = 19-19 lines in 3 locations

tests/MetadataManagerTest.php 3 locations

@@ 642-660 (lines=19) @@
639
        $this->assertEquals($expected, $actual);
640
    }
641
642
    public function testAddComplexType()
643
    {
644
        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
645
646
        $name = 'Name';
647
        $accessType = 'Public';
648
        $summary = new TTextType();
649
        $longDescription = new TTextType();
650
651
        $oldCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
652
653
        $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription);
654
655
        $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
656
        $this->assertEquals($oldCount+1, $newCount);
657
        $this->assertNotNull($result);
658
        $this->assertTrue($result instanceof TComplexTypeType, get_class($result));
659
        $this->assertNotNull($result->getDocumentation());
660
    }
661
662
    public function testAddComplexTypeWithOnlySummary()
663
    {
@@ 662-680 (lines=19) @@
659
        $this->assertNotNull($result->getDocumentation());
660
    }
661
662
    public function testAddComplexTypeWithOnlySummary()
663
    {
664
        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
665
666
        $name = 'Name';
667
        $accessType = 'Public';
668
        $summary = new TTextType();
669
        $longDescription = null;
670
671
        $oldCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
672
673
        $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription);
674
675
        $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
676
        $this->assertEquals($oldCount+1, $newCount);
677
        $this->assertNotNull($result);
678
        $this->assertTrue($result instanceof TComplexTypeType, get_class($result));
679
        $this->assertNull($result->getDocumentation());
680
    }
681
682
    public function testAddComplexTypeWithOnlyDescription()
683
    {
@@ 682-700 (lines=19) @@
679
        $this->assertNull($result->getDocumentation());
680
    }
681
682
    public function testAddComplexTypeWithOnlyDescription()
683
    {
684
        list(, $metadataManager, , ) = $this->setUpMetadataForNavTests();
685
686
        $name = 'Name';
687
        $accessType = 'Public';
688
        $summary = null;
689
        $longDescription = new TTextType();
690
691
        $oldCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
692
693
        $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription);
694
695
        $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType());
696
        $this->assertEquals($oldCount+1, $newCount);
697
        $this->assertNotNull($result);
698
        $this->assertTrue($result instanceof TComplexTypeType, get_class($result));
699
        $this->assertNull($result->getDocumentation());
700
    }
701
702
    public function testAddPropertyToComplexTypeDefaultValueArray()
703
    {