Code Duplication    Length = 19-19 lines in 3 locations

tests/MetadataManagerTest.php 3 locations

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