From b39d9bc6fceac1843dee491bf13f41c8e34988a4 Mon Sep 17 00:00:00 2001 From: Dariusz Rup Date: Fri, 17 Jan 2025 14:42:20 +0100 Subject: [PATCH] OP-549 - Sylius 2 - update composer.json and bundles, add http_discovery --- composer.json | 22 +++++++++++-------- tests/Application/Kernel.php | 12 ++-------- tests/Application/config/bundles.php | 17 ++++++-------- .../Application/config/packages/_sylius.yaml | 4 +--- .../config/packages/http_discovery.yaml | 10 +++++++++ .../config/symfony/6.x/bundles.php | 5 +++++ 6 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 tests/Application/config/packages/http_discovery.yaml create mode 100644 tests/Application/config/symfony/6.x/bundles.php diff --git a/composer.json b/composer.json index 7a99e6a7..55c3d8dd 100644 --- a/composer.json +++ b/composer.json @@ -10,24 +10,27 @@ "license": "MIT", "require": { "php": "^8.2", - "sylius/grid-bundle": "^1.13@alpha", - "sylius/sylius": "~v2.0.0-alpha.2", - "sylius/twig-hooks": "^0.3.0", - "symfony/ux-autocomplete": "^2.20", + "dompdf/dompdf": "^2.0", + "sylius/calendar": "^0.5.0", + "sylius/grid-bundle": "^1.13.0", + "sylius/sylius": "~2.0", + "sylius/twig-extra": "^0.5", + "sylius/twig-hooks": "^0.5", + "symfony/stimulus-bundle": "^2.12", + "symfony/ux-autocomplete": "^2.17", "symfony/ux-live-component": "^2.20", "symfony/ux-twig-component": "^2.20", "symfony/webpack-encore-bundle": "^2.1", - "symfony/stimulus-bundle": "^2.20", + "symfony/workflow": "^7.2", + "willdurand/hateoas-bundle": "2.5.0", "league/csv": "^9.1", "friendsofsymfony/ckeditor-bundle": "^2.0", - "sylius/calendar": "^0.5.0", - "willdurand/hateoas-bundle": "^2.5", "api-platform/core": "^3.4", "sylius-labs/polyfill-symfony-security": "^1.1" }, "require-dev": { "behat/behat": "^3.7", - "behat/mink-selenium2-driver": "~1.6.0", + "behat/mink-selenium2-driver": "1.6", "dbrekelmans/bdi": "^1.1", "bitbag/coding-standard": "^3.0", "dmore/behat-chrome-extension": "^1.3", @@ -83,7 +86,8 @@ "dealerdirect/phpcodesniffer-composer-installer": false, "phpstan/extension-installer": false, "symfony/flex": false, - "symfony/runtime": true + "symfony/runtime": true, + "php-http/discovery": true } }, "extra": { diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index ac154b4d..1da5f3cb 100755 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -5,7 +5,6 @@ namespace Tests\Sylius\CmsPlugin\Application; use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; -use Sylius\Bundle\CoreBundle\SyliusCoreBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\DelegatingLoader; use Symfony\Component\Config\Loader\LoaderInterface; @@ -58,15 +57,11 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); $container->setParameter('container.dumper.inline_class_loader', true); $confDir = $this->getProjectDir() . '/config'; - $syliusDir = $this->getProjectDir() . '/config/sylius/' . SyliusCoreBundle::MAJOR_VERSION . '.' . SyliusCoreBundle::MINOR_VERSION; $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); - if (is_dir($syliusDir)) { - $loader->load($syliusDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); - } $loader->load($confDir . '/{api_resources}/*' . self::CONFIG_EXTS, 'glob'); } @@ -135,11 +130,8 @@ private function registerBundlesFromFile(string $bundlesFile): iterable private function getConfigurationDirectories(): iterable { yield $this->getProjectDir() . '/config'; - $syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusCoreBundle::MAJOR_VERSION . '.' . SyliusCoreBundle::MINOR_VERSION; - if (is_dir($syliusConfigDir)) { - yield $syliusConfigDir; - } - $symfonyConfigDir = $this->getProjectDir() . '/config/symfony/' . BaseKernel::MAJOR_VERSION . '.' . BaseKernel::MINOR_VERSION; + + $symfonyConfigDir = $this->getProjectDir() . '/config/symfony/' . BaseKernel::MAJOR_VERSION . 'x'; if (is_dir($symfonyConfigDir)) { yield $symfonyConfigDir; } diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 4cbb1eaa..acc2f75f 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -3,12 +3,13 @@ declare(strict_types=1); return [ + FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], + Sylius\CmsPlugin\SyliusCmsPlugin::class => ['all' => true], Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true], Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true], Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true], @@ -31,11 +32,6 @@ Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true], Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], - winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], - Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], - Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true], - JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], - FOS\RestBundle\FOSRestBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], @@ -53,18 +49,19 @@ Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true], + Sylius\Behat\Application\SyliusTestPlugin\SyliusTestPlugin::class => ['test' => true, 'test_cached' => true], ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], - SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], - FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], - Sylius\CmsPlugin\SyliusCmsPlugin::class => ['all' => true], - Sylius\TwigHooks\TwigHooksBundle::class => ['all' => true], + Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true], Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true], Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true], Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], + Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true], + Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], + Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true] ]; diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 612c68af..bb9008d4 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -1,10 +1,8 @@ imports: - { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" } - + - { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" } - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } - { resource: "../parameters.yaml" } diff --git a/tests/Application/config/packages/http_discovery.yaml b/tests/Application/config/packages/http_discovery.yaml new file mode 100644 index 00000000..8be5f3d8 --- /dev/null +++ b/tests/Application/config/packages/http_discovery.yaml @@ -0,0 +1,10 @@ +services: + Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory' + + http_discovery.psr17_factory: + class: Http\Discovery\Psr17Factory diff --git a/tests/Application/config/symfony/6.x/bundles.php b/tests/Application/config/symfony/6.x/bundles.php new file mode 100644 index 00000000..5c41e0f4 --- /dev/null +++ b/tests/Application/config/symfony/6.x/bundles.php @@ -0,0 +1,5 @@ + ['all' => true], +];