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