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