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