Skip to content

Commit 8830e1f

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

Some content is hidden

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

54 files changed

+231
-282
lines changed

composer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,16 @@
4141
"require-dev": {
4242
"api-platform/core": "^2.7 || ^3.4",
4343
"babdev/pagerfanta-bundle": "^4.4",
44-
"behat/behat": "^3.14",
44+
"behat/behat": "^3.16",
4545
"doctrine/doctrine-bundle": "^2.11",
46+
"friends-of-behat/mink": "^1.11",
47+
"friends-of-behat/mink-browserkit-driver": "^1.6",
48+
"friends-of-behat/mink-debug-extension": "^2.1",
49+
"friends-of-behat/mink-extension": "^2.7",
50+
"friends-of-behat/page-object-extension": "^0.3",
51+
"friends-of-behat/suite-settings-extension": "^1.1",
52+
"friends-of-behat/symfony-extension": "^2.6",
53+
"friends-of-behat/variadic-extension": "^1.6",
4654
"infection/infection": "^0.27.9",
4755
"jms/serializer-bundle": "^5.5",
4856
"lexik/jwt-authentication-bundle": "^3.1",

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';

0 commit comments

Comments
 (0)