@@ 700-724 (lines=25) @@ | ||
697 | $this->assertEquals($expected, $actual); |
|
698 | } |
|
699 | ||
700 | public function testAddPropertyToComplexTypeDefaultValueBoolean() |
|
701 | { |
|
702 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
703 | $complex = m::mock(TComplexTypeType::class); |
|
704 | $complex->shouldReceive('addToProperty') |
|
705 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
|
706 | $name = 'name'; |
|
707 | $type = 'type'; |
|
708 | $defaultValue = true; |
|
709 | $summary = new TTextType(); |
|
710 | $longDescription = new TTextType(); |
|
711 | $expectedDefault = 'true'; |
|
712 | ||
713 | $result = $metadataManager->addPropertyToComplexType( |
|
714 | $complex, |
|
715 | $name, |
|
716 | $type, |
|
717 | $defaultValue, |
|
718 | false, |
|
719 | $summary, |
|
720 | $longDescription |
|
721 | ); |
|
722 | $this->assertEquals(1, count($result->getDocumentation())); |
|
723 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
724 | } |
|
725 | ||
726 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlySummary() |
|
727 | { |
|
@@ 726-751 (lines=26) @@ | ||
723 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
724 | } |
|
725 | ||
726 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlySummary() |
|
727 | { |
|
728 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
729 | $complex = m::mock(TComplexTypeType::class); |
|
730 | $complex->shouldReceive('addToProperty') |
|
731 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
|
732 | $name = 'name'; |
|
733 | $type = 'type'; |
|
734 | $defaultValue = true; |
|
735 | $summary = new TTextType(); |
|
736 | $longDescription = null; |
|
737 | $expectedDefault = 'true'; |
|
738 | ||
739 | $result = $metadataManager->addPropertyToComplexType( |
|
740 | $complex, |
|
741 | $name, |
|
742 | $type, |
|
743 | $defaultValue, |
|
744 | false, |
|
745 | $summary, |
|
746 | $longDescription |
|
747 | ); |
|
748 | $this->assertNotNull($result); |
|
749 | $this->assertEquals(0, count($result->getDocumentation())); |
|
750 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
751 | } |
|
752 | ||
753 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlyDescription() |
|
754 | { |
|
@@ 753-777 (lines=25) @@ | ||
750 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
751 | } |
|
752 | ||
753 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlyDescription() |
|
754 | { |
|
755 | list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
756 | $complex = m::mock(TComplexTypeType::class); |
|
757 | $complex->shouldReceive('addToProperty') |
|
758 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
|
759 | $name = 'name'; |
|
760 | $type = 'type'; |
|
761 | $defaultValue = true; |
|
762 | $summary = null; |
|
763 | $longDescription = new TTextType(); |
|
764 | $expectedDefault = 'true'; |
|
765 | ||
766 | $result = $metadataManager->addPropertyToComplexType( |
|
767 | $complex, |
|
768 | $name, |
|
769 | $type, |
|
770 | $defaultValue, |
|
771 | false, |
|
772 | $summary, |
|
773 | $longDescription |
|
774 | ); |
|
775 | $this->assertEquals(0, count($result->getDocumentation())); |
|
776 | $this->assertEquals($expectedDefault, $result->getDefaultValue()); |
|
777 | } |
|
778 | ||
779 | public function testAddPropertyToEntityType() |
|
780 | { |