Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maintenance][Behat] Autoload calendar contexts into container #15809

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion config/services_test.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Sylius/Behat/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
};