@@ 751-775 (lines=25) @@ | ||
748 | $this->assertEquals($expected, $actual); |
|
749 | } |
|
750 | ||
751 | public function testAddPropertyToComplexTypeDefaultValueBoolean() |
|
752 | { |
|
753 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
754 | $complex = m::mock(TComplexTypeType::class); |
|
755 | $complex->shouldReceive('addToProperty') |
|
756 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
|
757 | $name = "name"; |
|
758 | $type = "type"; |
|
759 | $defaultValue = true; |
|
760 | $summary = new TTextType(); |
|
761 | $longDescription = new TTextType(); |
|
762 | $expectedDefault = 'true'; |
|
763 | ||
764 | $result = $metadataManager->addPropertyToComplexType( |
|
765 | $complex, |
|
766 | $name, |
|
767 | $type, |
|
768 | $defaultValue, |
|
769 | false, |
|
770 | $summary, |
|
771 | $longDescription |
|
772 | ); |
|
773 | $this->assertEquals(1, count($result->getDocumentation())); |
|
774 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
775 | } |
|
776 | ||
777 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlySummary() |
|
778 | { |
|
@@ 777-802 (lines=26) @@ | ||
774 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
775 | } |
|
776 | ||
777 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlySummary() |
|
778 | { |
|
779 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
780 | $complex = m::mock(TComplexTypeType::class); |
|
781 | $complex->shouldReceive('addToProperty') |
|
782 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
|
783 | $name = "name"; |
|
784 | $type = "type"; |
|
785 | $defaultValue = true; |
|
786 | $summary = new TTextType(); |
|
787 | $longDescription = null; |
|
788 | $expectedDefault = 'true'; |
|
789 | ||
790 | $result = $metadataManager->addPropertyToComplexType( |
|
791 | $complex, |
|
792 | $name, |
|
793 | $type, |
|
794 | $defaultValue, |
|
795 | false, |
|
796 | $summary, |
|
797 | $longDescription |
|
798 | ); |
|
799 | $this->assertNotNull($result); |
|
800 | $this->assertEquals(0, count($result->getDocumentation())); |
|
801 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
802 | } |
|
803 | ||
804 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlyDescription() |
|
805 | { |
|
@@ 804-828 (lines=25) @@ | ||
801 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
802 | } |
|
803 | ||
804 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlyDescription() |
|
805 | { |
|
806 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
807 | $complex = m::mock(TComplexTypeType::class); |
|
808 | $complex->shouldReceive('addToProperty') |
|
809 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
|
810 | $name = "name"; |
|
811 | $type = "type"; |
|
812 | $defaultValue = true; |
|
813 | $summary = null; |
|
814 | $longDescription = new TTextType(); |
|
815 | $expectedDefault = 'true'; |
|
816 | ||
817 | $result = $metadataManager->addPropertyToComplexType( |
|
818 | $complex, |
|
819 | $name, |
|
820 | $type, |
|
821 | $defaultValue, |
|
822 | false, |
|
823 | $summary, |
|
824 | $longDescription |
|
825 | ); |
|
826 | $this->assertEquals(0, count($result->getDocumentation())); |
|
827 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
828 | } |
|
829 | ||
830 | public function testAddPropertyToEntityType() |
|
831 | { |