Skip to content

Commit d1b9fbb

Browse files
committed
Migrate test/Application to Sylius 2.x
1 parent 367729f commit d1b9fbb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+208
-281
lines changed

tests/Application/.env

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
# In all environments, the following files are loaded if they exist,
2-
# the later taking precedence over the former:
3-
#
4-
# * .env contains default values for the environment variables needed by the app
5-
# * .env.local uncommitted file with local overrides
6-
# * .env.$APP_ENV committed environment-specific defaults
7-
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8-
#
9-
# Real environment variables win over .env files.
10-
#
11-
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12-
#
13-
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
1+
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
2+
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
143
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
154

165
###> symfony/framework-bundle ###
@@ -20,7 +9,7 @@ APP_SECRET=EDITME
209
###< symfony/framework-bundle ###
2110

2211
###> doctrine/doctrine-bundle ###
23-
# Format described at https://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
12+
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
2413
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
2514
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
2615
DATABASE_URL=mysql://[email protected]/setono_sylius_terms_%kernel.environment%?serverVersion=5.7
@@ -32,16 +21,15 @@ JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
3221
JWT_PASSPHRASE=acme_plugin_development
3322
###< lexik/jwt-authentication-bundle ###
3423

24+
###> symfony/mailer ###
25+
MAILER_DSN=null://null
26+
###< symfony/mailer ###
27+
3528
###> symfony/messenger ###
36-
# Choose one of the transports below
37-
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
38-
MESSENGER_TRANSPORT_DSN=doctrine://default
39-
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
29+
SYLIUS_MESSENGER_TRANSPORT_MAIN_DSN=doctrine://default
30+
SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN=doctrine://default?queue_name=main_failed
31+
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN=doctrine://default?queue_name=catalog_promotion_removal
32+
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=doctrine://default?queue_name=catalog_promotion_removal_failed
33+
SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_DSN=doctrine://default?queue_name=payment_request
34+
SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_FAILED_DSN=doctrine://default?queue_name=payment_request_failed
4035
###< symfony/messenger ###
41-
42-
###> symfony/swiftmailer-bundle ###
43-
# For Gmail as a transport, use: "gmail://username:password@localhost"
44-
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
45-
# Delivery is disabled by default via "null://localhost"
46-
MAILER_DSN=null://localhost
47-
###< symfony/swiftmailer-bundle ###

tests/Application/.eslintrc.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
module.exports = {
2-
extends: 'airbnb-base',
3-
env: {
4-
node: true,
5-
},
6-
rules: {
7-
'object-shorthand': ['error', 'always', {
8-
avoidQuotes: true,
9-
avoidExplicitReturnArrows: true,
10-
}],
11-
'function-paren-newline': ['error', 'consistent'],
12-
'max-len': ['warn', 120, 2, {
13-
ignoreUrls: true,
14-
ignoreComments: false,
15-
ignoreRegExpLiterals: true,
16-
ignoreStrings: true,
17-
ignoreTemplateLiterals: true,
18-
}],
19-
},
2+
extends: 'airbnb-base',
3+
env: {
4+
node: true,
5+
},
6+
rules: {
7+
'object-shorthand': ['error', 'always', {
8+
avoidQuotes: true,
9+
avoidExplicitReturnArrows: true,
10+
}],
11+
'function-paren-newline': ['error', 'consistent'],
12+
'max-len': ['warn', 120, 2, {
13+
ignoreUrls: true,
14+
ignoreComments: false,
15+
ignoreRegExpLiterals: true,
16+
ignoreStrings: true,
17+
ignoreTemplateLiterals: true,
18+
}],
19+
},
2020
};

tests/Application/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
!/public/media/image/.gitignore
99

1010
/node_modules
11+
/yarn.lock
12+
/package-lock.json
1113

1214
###> symfony/framework-bundle ###
1315
/.env.*.local
@@ -21,3 +23,8 @@
2123
###> symfony/web-server-bundle ###
2224
/.web-server-pid
2325
###< symfony/web-server-bundle ###
26+
27+
###> lexik/jwt-authentication-bundle ###
28+
/config/jwt/*.pem
29+
!/config/jwt/*-test.pem
30+
###< lexik/jwt-authentication-bundle ###

tests/Application/assets/admin/entry.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/Application/assets/admin/entrypoint.js

Whitespace-only changes.

tests/Application/assets/shop/entry.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '../../../../assets/shop/entrypoint';

tests/Application/bin/console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Setono\SyliusTermsPlugin\Tests\Application\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
66
use Symfony\Component\Console\Input\ArgvInput;
7-
use Symfony\Component\ErrorHandler\Debug;
7+
use Symfony\Component\Debug\Debug;
88

99
set_time_limit(0);
1010

tests/Application/config/bootstrap.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@
1313
$_ENV += $env;
1414
} elseif (!class_exists(Dotenv::class)) {
1515
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
16+
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
17+
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
18+
19+
return;
1620
} else {
1721
// load all the .env files
18-
(new Dotenv())->loadEnv(dirname(__DIR__) . '/.env');
22+
(new Dotenv(true))->loadEnv(dirname(__DIR__) . '/.env');
1923
}
2024

2125
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';

tests/Application/config/bundles.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
return [
5+
$bundles = [
66
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
77
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
88
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
@@ -31,13 +31,8 @@
3131
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
3232
Setono\SyliusTermsPlugin\SetonoSyliusTermsPlugin::class => ['all' => true],
3333
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
34-
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
35-
Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
36-
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
37-
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
3834
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
3935
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
40-
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
4136
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
4237
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
4338
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
@@ -49,12 +44,25 @@
4944
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],
5045
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
5146
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
52-
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
53-
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
47+
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
5448
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
49+
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
5550
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
5651
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
57-
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
5852
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
59-
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
53+
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
54+
Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true],
55+
Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true],
56+
Symfony\UX\Icons\UXIconsBundle::class => ['all' => true],
57+
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
58+
Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
59+
Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true],
60+
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
61+
Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true],
6062
];
63+
64+
if (class_exists(winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class)) {
65+
$bundles[winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class] = ['all' => true];
66+
}
67+
68+
return $bundles;

tests/Application/config/packages/_sylius.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
imports:
22
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }
3+
- { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" }
34
- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
45
- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
56
- { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
api_platform:
2-
mapping:
3-
paths:
4-
- '%kernel.project_dir%/../../vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/api_resources'
5-
- '%kernel.project_dir%/config/api_platform'
6-
patch_formats:
7-
json: ['application/merge-patch+json']
8-
swagger:
9-
versions: [3]
2+
mapping:
3+
paths:
4+
- '%kernel.project_dir%/../../vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/api_platform'
5+
- '%kernel.project_dir%/config/api_platform'
6+
- '%kernel.project_dir%/src/Entity'
7+
patch_formats:
8+
json: ['application/merge-patch+json']
9+
swagger:
10+
versions: [3]

tests/Application/config/packages/assets.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ framework:
55
json_manifest_path: '%kernel.project_dir%/public/build/shop/manifest.json'
66
admin:
77
json_manifest_path: '%kernel.project_dir%/public/build/admin/manifest.json'
8+
app.admin:
9+
json_manifest_path: '%kernel.project_dir%/public/build/app/admin/manifest.json'
10+
app.shop:
11+
json_manifest_path: '%kernel.project_dir%/public/build/app/shop/manifest.json'

tests/Application/config/packages/dev/jms_serializer.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/Application/config/packages/doctrine_migrations.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ doctrine_migrations:
22
storage:
33
table_storage:
44
table_name: sylius_migrations
5+
migrations_paths:
6+
'App\Migrations': '%kernel.project_dir%/../../src/Migrations/'

tests/Application/config/packages/fos_rest.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
framework:
22
secret: '%env(APP_SECRET)%'
3-
ide: phpstorm
4-
form:
5-
enabled: true
6-
legacy_error_messages: false
3+
form: true
74
csrf_protection: true
85
session:
96
handler_id: ~
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory'
3+
Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory'
4+
Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory'
5+
Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory'
6+
Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory'
7+
Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory'
8+
9+
http_discovery.psr17_factory:
10+
class: Http\Discovery\Psr17Factory

tests/Application/config/packages/jms_serializer.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/Application/config/packages/prod/jms_serializer.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)