mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
[Maintenance][Behat] Autoload calendar contexts into container
This commit is contained in:
parent
0b367ee50d
commit
2bb4e0d26c
3 changed files with 21 additions and 1 deletions
|
|
@ -1,5 +1,4 @@
|
|||
imports:
|
||||
- { resource: "../vendor/sylius/calendar/tests/Behat/Resources/services.yaml" }
|
||||
- { resource: "../src/Sylius/Behat/Resources/config/services.xml" }
|
||||
|
||||
# workaround needed for strange "test.client.history" problem
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||
<imports>
|
||||
<import resource="services/_calendar_services.php" />
|
||||
<import resource="services/api.xml" />
|
||||
<import resource="services/contexts.xml" />
|
||||
<import resource="services/elements.xml" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
// Calendar ^0.5 changed the location of behat services
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$baseSyliusCalendarDir = __DIR__ . '/../../../../../../vendor/sylius/calendar/tests/Behat/Resources/services.yaml';
|
||||
if (file_exists($baseSyliusCalendarDir)) {
|
||||
$containerConfigurator->import($baseSyliusCalendarDir);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$appSyliusCalendarDir = __DIR__ . '/../../../../../../../../sylius/calendar/tests/Behat/Resources/services.yaml';
|
||||
if (file_exists($appSyliusCalendarDir)) {
|
||||
$containerConfigurator->import($appSyliusCalendarDir);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue