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