Skip to content

Commit

Permalink
[Maintenance] Refactor test app config
Browse files Browse the repository at this point in the history
  • Loading branch information
coldic3 committed Nov 2, 2022
1 parent 2048ec2 commit 2254fef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
12 changes: 0 additions & 12 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,6 @@ private function registerBundlesFromFile(string $bundlesFile): iterable
{
$contents = require $bundlesFile;

if (SyliusKernel::MINOR_VERSION > 11) {
$contents = array_merge(
['League\FlysystemBundle\FlysystemBundle' => ['all' => true]],
$contents,
);
} else {
$contents = array_merge(
['Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle' => ['all' => true]],
$contents,
);
}

foreach ($contents as $class => $envs) {
if (isset($envs['all']) || isset($envs[$this->environment])) {
yield new $class();
Expand Down
12 changes: 11 additions & 1 deletion tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

return [
use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel;

$bundles = [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Expand Down Expand Up @@ -58,3 +60,11 @@
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
];

if (SyliusKernel::MINOR_VERSION > 11) {
$bundles[League\FlysystemBundle\FlysystemBundle::class] = ['all' => true];
} else {
$bundles[Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class] = ['all' => true];
}

return $bundles;

0 comments on commit 2254fef

Please sign in to comment.