Skip to content

Commit

Permalink
OP-549 - Sylius 2 - update composer.json and bundles, add http_discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusz-rup committed Jan 17, 2025
1 parent 3fb6be7 commit b39d9bc
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 32 deletions.
22 changes: 13 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
12 changes: 2 additions & 10 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}

Expand Down Expand Up @@ -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;
}
Expand Down
17 changes: 7 additions & 10 deletions tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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],
Expand All @@ -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]
];
4 changes: 1 addition & 3 deletions tests/Application/config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
@@ -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" }

Expand Down
10 changes: 10 additions & 0 deletions tests/Application/config/packages/http_discovery.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/Application/config/symfony/6.x/bundles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
];

0 comments on commit b39d9bc

Please sign in to comment.