| @@ 570-590 (lines=21) @@ | ||
| 567 | $this->assertNull($result->getDocumentation()); |
|
| 568 | } |
|
| 569 | ||
| 570 | public function testMalformedMultiplicity() |
|
| 571 | { |
|
| 572 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
|
| 573 | ||
| 574 | $expected = 'Malformed multiplicity - valid values are *, 0..1 and 1'; |
|
| 575 | $actual = null; |
|
| 576 | ||
| 577 | try { |
|
| 578 | $metadataManager->addNavigationPropertyToEntityType( |
|
| 579 | $CategoryType, |
|
| 580 | '1', |
|
| 581 | 'Customers', |
|
| 582 | $CustomerType, |
|
| 583 | 'ABC', |
|
| 584 | 'Categories' |
|
| 585 | ); |
|
| 586 | } catch (\InvalidArgumentException $e) { |
|
| 587 | $actual = $e->getMessage(); |
|
| 588 | } |
|
| 589 | $this->assertEquals($expected, $actual); |
|
| 590 | } |
|
| 591 | ||
| 592 | public function testInvalidMultiplicityBelongsOnBothEnds() |
|
| 593 | { |
|
| @@ 592-612 (lines=21) @@ | ||
| 589 | $this->assertEquals($expected, $actual); |
|
| 590 | } |
|
| 591 | ||
| 592 | public function testInvalidMultiplicityBelongsOnBothEnds() |
|
| 593 | { |
|
| 594 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
|
| 595 | ||
| 596 | $expected = 'Invalid multiplicity combination - 1 1'; |
|
| 597 | $actual = null; |
|
| 598 | ||
| 599 | try { |
|
| 600 | $metadataManager->addNavigationPropertyToEntityType( |
|
| 601 | $CategoryType, |
|
| 602 | '1', |
|
| 603 | 'Customers', |
|
| 604 | $CustomerType, |
|
| 605 | '1', |
|
| 606 | 'Categories' |
|
| 607 | ); |
|
| 608 | } catch (\InvalidArgumentException $e) { |
|
| 609 | $actual = $e->getMessage(); |
|
| 610 | } |
|
| 611 | $this->assertEquals($expected, $actual); |
|
| 612 | } |
|
| 613 | ||
| 614 | public function testInvalidMultiplicityManyToHasMany() |
|
| 615 | { |
|
| @@ 614-634 (lines=21) @@ | ||
| 611 | $this->assertEquals($expected, $actual); |
|
| 612 | } |
|
| 613 | ||
| 614 | public function testInvalidMultiplicityManyToHasMany() |
|
| 615 | { |
|
| 616 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
|
| 617 | ||
| 618 | $expected = 'Invalid multiplicity combination - * 0..1'; |
|
| 619 | $actual = null; |
|
| 620 | ||
| 621 | try { |
|
| 622 | $metadataManager->addNavigationPropertyToEntityType( |
|
| 623 | $CategoryType, |
|
| 624 | '*', |
|
| 625 | 'Customers', |
|
| 626 | $CustomerType, |
|
| 627 | '0..1', |
|
| 628 | 'Categories' |
|
| 629 | ); |
|
| 630 | } catch (\InvalidArgumentException $e) { |
|
| 631 | $actual = $e->getMessage(); |
|
| 632 | } |
|
| 633 | $this->assertEquals($expected, $actual); |
|
| 634 | } |
|
| 635 | ||
| 636 | public function testAddComplexType() |
|
| 637 | { |
|