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