| @@ 587-607 (lines=21) @@ | ||
| 584 | $this->assertNull($result->getDocumentation()); |
|
| 585 | } |
|
| 586 | ||
| 587 | public function testMalformedMultiplicity() |
|
| 588 | { |
|
| 589 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
|
| 590 | ||
| 591 | $expected = "Malformed multiplicity - valid values are *, 0..1 and 1"; |
|
| 592 | $actual = null; |
|
| 593 | ||
| 594 | try { |
|
| 595 | $metadataManager->addNavigationPropertyToEntityType( |
|
| 596 | $CategoryType, |
|
| 597 | "1", |
|
| 598 | "Customers", |
|
| 599 | $CustomerType, |
|
| 600 | "ABC", |
|
| 601 | "Categories" |
|
| 602 | ); |
|
| 603 | } catch (\InvalidArgumentException $e) { |
|
| 604 | $actual = $e->getMessage(); |
|
| 605 | } |
|
| 606 | $this->assertEquals($expected, $actual); |
|
| 607 | } |
|
| 608 | ||
| 609 | public function testInvalidMultiplicityBelongsOnBothEnds() |
|
| 610 | { |
|
| @@ 609-629 (lines=21) @@ | ||
| 606 | $this->assertEquals($expected, $actual); |
|
| 607 | } |
|
| 608 | ||
| 609 | public function testInvalidMultiplicityBelongsOnBothEnds() |
|
| 610 | { |
|
| 611 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
|
| 612 | ||
| 613 | $expected = "Invalid multiplicity combination - 1 1"; |
|
| 614 | $actual = null; |
|
| 615 | ||
| 616 | try { |
|
| 617 | $metadataManager->addNavigationPropertyToEntityType( |
|
| 618 | $CategoryType, |
|
| 619 | "1", |
|
| 620 | "Customers", |
|
| 621 | $CustomerType, |
|
| 622 | "1", |
|
| 623 | "Categories" |
|
| 624 | ); |
|
| 625 | } catch (\InvalidArgumentException $e) { |
|
| 626 | $actual = $e->getMessage(); |
|
| 627 | } |
|
| 628 | $this->assertEquals($expected, $actual); |
|
| 629 | } |
|
| 630 | ||
| 631 | public function testInvalidMultiplicityManyToHasMany() |
|
| 632 | { |
|
| @@ 631-651 (lines=21) @@ | ||
| 628 | $this->assertEquals($expected, $actual); |
|
| 629 | } |
|
| 630 | ||
| 631 | public function testInvalidMultiplicityManyToHasMany() |
|
| 632 | { |
|
| 633 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
|
| 634 | ||
| 635 | $expected = "Invalid multiplicity combination - * 0..1"; |
|
| 636 | $actual = null; |
|
| 637 | ||
| 638 | try { |
|
| 639 | $metadataManager->addNavigationPropertyToEntityType( |
|
| 640 | $CategoryType, |
|
| 641 | "*", |
|
| 642 | "Customers", |
|
| 643 | $CustomerType, |
|
| 644 | "0..1", |
|
| 645 | "Categories" |
|
| 646 | ); |
|
| 647 | } catch (\InvalidArgumentException $e) { |
|
| 648 | $actual = $e->getMessage(); |
|
| 649 | } |
|
| 650 | $this->assertEquals($expected, $actual); |
|
| 651 | } |
|
| 652 | ||
| 653 | public function testAddComplexType() |
|
| 654 | { |
|