@@ 602-620 (lines=19) @@ | ||
599 | $this->assertEquals($expected, $actual); |
|
600 | } |
|
601 | ||
602 | public function testAddComplexType() |
|
603 | { |
|
604 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
605 | ||
606 | $name = 'Name'; |
|
607 | $accessType = 'Public'; |
|
608 | $summary = new TTextType(); |
|
609 | $longDescription = new TTextType(); |
|
610 | ||
611 | $oldCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
|
612 | ||
613 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
|
614 | ||
615 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
|
616 | $this->assertEquals($oldCount+1, $newCount); |
|
617 | $this->assertNotNull($result); |
|
618 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
|
619 | $this->assertNotNull($result->getDocumentation()); |
|
620 | } |
|
621 | ||
622 | public function testAddComplexTypeWithOnlySummary() |
|
623 | { |
|
@@ 622-640 (lines=19) @@ | ||
619 | $this->assertNotNull($result->getDocumentation()); |
|
620 | } |
|
621 | ||
622 | public function testAddComplexTypeWithOnlySummary() |
|
623 | { |
|
624 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
625 | ||
626 | $name = 'Name'; |
|
627 | $accessType = 'Public'; |
|
628 | $summary = new TTextType(); |
|
629 | $longDescription = null; |
|
630 | ||
631 | $oldCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
|
632 | ||
633 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
|
634 | ||
635 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
|
636 | $this->assertEquals($oldCount+1, $newCount); |
|
637 | $this->assertNotNull($result); |
|
638 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
|
639 | $this->assertNull($result->getDocumentation()); |
|
640 | } |
|
641 | ||
642 | public function testAddComplexTypeWithOnlyDescription() |
|
643 | { |
|
@@ 642-660 (lines=19) @@ | ||
639 | $this->assertNull($result->getDocumentation()); |
|
640 | } |
|
641 | ||
642 | public function testAddComplexTypeWithOnlyDescription() |
|
643 | { |
|
644 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
645 | ||
646 | $name = 'Name'; |
|
647 | $accessType = 'Public'; |
|
648 | $summary = null; |
|
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->assertNull($result->getDocumentation()); |
|
660 | } |
|
661 | ||
662 | public function testAddPropertyToComplexTypeDefaultValueArray() |
|
663 | { |