| @@ 498-536 (lines=39) @@ | ||
| 495 | ); |
|
| 496 | } |
|
| 497 | ||
| 498 | public function testRepositoriesConfigurationStorageEmpty() |
|
| 499 | { |
|
| 500 | $repositories = [ |
|
| 501 | 'main' => [ |
|
| 502 | 'search' => [ |
|
| 503 | 'engine' => 'fantasticfind', |
|
| 504 | 'connection' => 'french', |
|
| 505 | ], |
|
| 506 | ], |
|
| 507 | ]; |
|
| 508 | $expectedRepositories = [ |
|
| 509 | 'main' => [ |
|
| 510 | 'search' => [ |
|
| 511 | 'engine' => 'fantasticfind', |
|
| 512 | 'connection' => 'french', |
|
| 513 | 'config' => [], |
|
| 514 | ], |
|
| 515 | 'storage' => [ |
|
| 516 | 'engine' => '%ezpublish.api.storage_engine.default%', |
|
| 517 | 'connection' => null, |
|
| 518 | 'config' => [], |
|
| 519 | ], |
|
| 520 | 'fields_groups' => [ |
|
| 521 | 'list' => ['content', 'metadata'], |
|
| 522 | 'default' => '%ezsettings.default.content.field_groups.default%', |
|
| 523 | ], |
|
| 524 | 'options' => [ |
|
| 525 | 'default_version_archive_limit' => 5, |
|
| 526 | ], |
|
| 527 | ], |
|
| 528 | ]; |
|
| 529 | $this->load(['repositories' => $repositories]); |
|
| 530 | $this->assertTrue($this->container->hasParameter('ezpublish.repositories')); |
|
| 531 | ||
| 532 | $this->assertSame( |
|
| 533 | $expectedRepositories, |
|
| 534 | $this->container->getParameter('ezpublish.repositories') |
|
| 535 | ); |
|
| 536 | } |
|
| 537 | ||
| 538 | public function testRepositoriesConfigurationSearchEmpty() |
|
| 539 | { |
|
| @@ 538-576 (lines=39) @@ | ||
| 535 | ); |
|
| 536 | } |
|
| 537 | ||
| 538 | public function testRepositoriesConfigurationSearchEmpty() |
|
| 539 | { |
|
| 540 | $repositories = [ |
|
| 541 | 'main' => [ |
|
| 542 | 'storage' => [ |
|
| 543 | 'engine' => 'persistentprudence', |
|
| 544 | 'connection' => 'yes', |
|
| 545 | ], |
|
| 546 | ], |
|
| 547 | ]; |
|
| 548 | $expectedRepositories = [ |
|
| 549 | 'main' => [ |
|
| 550 | 'storage' => [ |
|
| 551 | 'engine' => 'persistentprudence', |
|
| 552 | 'connection' => 'yes', |
|
| 553 | 'config' => [], |
|
| 554 | ], |
|
| 555 | 'search' => [ |
|
| 556 | 'engine' => '%ezpublish.api.search_engine.default%', |
|
| 557 | 'connection' => null, |
|
| 558 | 'config' => [], |
|
| 559 | ], |
|
| 560 | 'fields_groups' => [ |
|
| 561 | 'list' => ['content', 'metadata'], |
|
| 562 | 'default' => '%ezsettings.default.content.field_groups.default%', |
|
| 563 | ], |
|
| 564 | 'options' => [ |
|
| 565 | 'default_version_archive_limit' => 5, |
|
| 566 | ], |
|
| 567 | ], |
|
| 568 | ]; |
|
| 569 | $this->load(['repositories' => $repositories]); |
|
| 570 | $this->assertTrue($this->container->hasParameter('ezpublish.repositories')); |
|
| 571 | ||
| 572 | $this->assertSame( |
|
| 573 | $expectedRepositories, |
|
| 574 | $this->container->getParameter('ezpublish.repositories') |
|
| 575 | ); |
|
| 576 | } |
|
| 577 | ||
| 578 | public function testRepositoriesConfigurationCompatibility() |
|
| 579 | { |
|
| @@ 647-683 (lines=37) @@ | ||
| 644 | ); |
|
| 645 | } |
|
| 646 | ||
| 647 | public function testRepositoriesConfigurationCompatibility2() |
|
| 648 | { |
|
| 649 | $repositories = [ |
|
| 650 | 'main' => [ |
|
| 651 | 'engine' => 'legacy', |
|
| 652 | 'connection' => 'default', |
|
| 653 | ], |
|
| 654 | ]; |
|
| 655 | $expectedRepositories = [ |
|
| 656 | 'main' => [ |
|
| 657 | 'storage' => [ |
|
| 658 | 'engine' => 'legacy', |
|
| 659 | 'connection' => 'default', |
|
| 660 | 'config' => [], |
|
| 661 | ], |
|
| 662 | 'search' => [ |
|
| 663 | 'engine' => '%ezpublish.api.search_engine.default%', |
|
| 664 | 'connection' => null, |
|
| 665 | 'config' => [], |
|
| 666 | ], |
|
| 667 | 'fields_groups' => [ |
|
| 668 | 'list' => ['content', 'metadata'], |
|
| 669 | 'default' => '%ezsettings.default.content.field_groups.default%', |
|
| 670 | ], |
|
| 671 | 'options' => [ |
|
| 672 | 'default_version_archive_limit' => 5, |
|
| 673 | ], |
|
| 674 | ], |
|
| 675 | ]; |
|
| 676 | $this->load(['repositories' => $repositories]); |
|
| 677 | $this->assertTrue($this->container->hasParameter('ezpublish.repositories')); |
|
| 678 | ||
| 679 | $this->assertSame( |
|
| 680 | $expectedRepositories, |
|
| 681 | $this->container->getParameter('ezpublish.repositories') |
|
| 682 | ); |
|
| 683 | } |
|
| 684 | ||
| 685 | public function testRegisteredPolicies() |
|
| 686 | { |
|