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