diff --git a/.env.test.dist b/.env.test.dist deleted file mode 100644 index 799a2bd..0000000 --- a/.env.test.dist +++ /dev/null @@ -1,9 +0,0 @@ -# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file -# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. -# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration - -###> symfony/framework-bundle ### -APP_ENV=test -APP_DEBUG=1 -APP_SECRET=EDITME -###< symfony/framework-bundle ### diff --git a/.gitignore b/.gitignore index dc3db21..829a5d4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,3 @@ !/etc/build/.gitkeep /tests/Application/yarn.lock - -.env.test diff --git a/.travis.yml b/.travis.yml index 59f817b..d43875d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ sudo: false php: - 7.2 + - 7.3 cache: yarn: true @@ -15,35 +16,26 @@ cache: env: global: + - APP_ENV=test - SYLIUS_CACHE_DIR=$HOME/.sylius-cache - SYLIUS_BUILD_DIR=etc/build - matrix: - - SYMFONY_VERSION="3.4.*" - - SYMFONY_VERSION="4.1.*" before_install: - phpenv config-rm xdebug.ini - echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - mkdir -p "${SYLIUS_CACHE_DIR}" - - cp tests/Application/.env.test.dist tests/Application/.env.test - - set -a && source tests/Application/.env.test && set +a - install: - - composer require symfony/symfony:${SYMFONY_VERSION} --no-interaction --no-update --no-scripts --update-with-all-dependencies --prefer-dist - composer install --no-interaction --prefer-dist - (cd tests/Application && yarn install) before_script: - - (cd tests/Application && bin/console doctrine:database:create --env=test -vvv) - - (cd tests/Application && bin/console doctrine:schema:create --env=test -vvv) - - (cd tests/Application && bin/console assets:install --env=test -vvv) - - (cd tests/Application && bin/console cache:warmup --env=test -vvv) + - (cd tests/Application && bin/console doctrine:database:create -vvv) + - (cd tests/Application && bin/console doctrine:schema:create -vvv) + - (cd tests/Application && bin/console assets:install public -vvv) + - (cd tests/Application && bin/console cache:warmup -vvv) - (cd tests/Application && yarn build) - # Running fixtures to be sure they're not failing - - (cd tests/Application && bin/console sylius:fixtures:load -n --env test) - # Configure display - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16 - export DISPLAY=:99 @@ -71,7 +63,7 @@ before_script: - java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 & # Run webserver - - (cd tests/Application && bin/console server:run 127.0.0.1:8080 --env=test --quiet > /dev/null 2>&1 &) + - (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d public --quiet > /dev/null 2>&1 &) script: - composer validate --strict diff --git a/behat.yml.dist b/behat.yml.dist index 343d00e..798fce8 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -1,24 +1,42 @@ imports: - - vendor/sylius/sylius/behat.yml.dist - tests/Behat/Resources/suites.yml default: extensions: - FriendsOfBehat\ContextServiceExtension: - imports: - - vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml - - tests/Behat/Resources/services.xml + Lakion\Behat\MinkDebugExtension: + directory: etc/build + clean_start: false + screenshot: true + + Behat\MinkExtension: + files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/" + base_url: "http://localhost:8080/" + default_session: symfony + javascript_session: chrome + sessions: + symfony: + symfony: ~ + chrome: + selenium2: + browser: chrome + capabilities: + browserName: chrome + browser: chrome + version: "" + marionette: null # https://github.com/Behat/MinkExtension/pull/311 + chrome: + switches: + - "start-fullscreen" + - "start-maximized" + - "no-sandbox" + firefox: + selenium2: + browser: firefox + show_auto: false FriendsOfBehat\SymfonyExtension: - env_file: tests/Application/.env.test + bootstrap: tests/Application/config/bootstrap.php kernel: - env: test - debug: true class: Tests\Sylius\CustomerReorderPlugin\Application\Kernel - path: tests/Application/src/Kernel.php - bootstrap: ~ - Lakion\Behat\MinkDebugExtension: - directory: etc/build - clean_start: false - screenshot: true + FriendsOfBehat\VariadicExtension: ~ diff --git a/composer.json b/composer.json index 1f9859e..c929535 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { "php": "^7.2", - "sylius/sylius": "^1.3" + "sylius/sylius": "^1.4" }, "require-dev": { "behat/behat": "^3.4", @@ -21,19 +21,17 @@ "behat/mink-browserkit-driver": "^1.3", "behat/mink-extension": "^2.2", "behat/mink-selenium2-driver": "^1.3", - "friends-of-behat/context-service-extension": "^1.2", - "friends-of-behat/cross-container-extension": "^1.1", - "friends-of-behat/service-container-extension": "^1.0", - "friends-of-behat/symfony-extension": "^1.2.1", + "friends-of-behat/page-object-extension": "^0.3", + "friends-of-behat/symfony-extension": "^2.0", "friends-of-behat/variadic-extension": "^1.1", "lakion/mink-debug-extension": "^1.2.3", - "phpspec/phpspec": "^4.0", - "phpstan/phpstan-shim": "^0.9.2", - "phpunit/phpunit": "^6.5", - "sylius-labs/coding-standard": "^2.0", + "phpspec/phpspec": "^5.0", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0", + "sylius-labs/coding-standard": "^3.0", "symfony/browser-kit": "^3.4|^4.1", "symfony/debug-bundle": "^3.4|^4.1", - "symfony/dotenv": "^3.4|^4.1", + "symfony/dotenv": "^4.2", "symfony/intl": "^3.4|^4.1", "symfony/web-profiler-bundle": "^3.4|^4.1", "symfony/web-server-bundle": "^3.4|^4.1" diff --git a/tests/Application/.env.dist b/tests/Application/.env similarity index 100% rename from tests/Application/.env.dist rename to tests/Application/.env diff --git a/tests/Application/.env.prod.dist b/tests/Application/.env.prod.dist deleted file mode 100644 index e9dc640..0000000 --- a/tests/Application/.env.prod.dist +++ /dev/null @@ -1,23 +0,0 @@ -# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file -# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. -# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration - -###> symfony/framework-bundle ### -APP_ENV=prod -APP_DEBUG=0 -APP_SECRET=EDITME -###< symfony/framework-bundle ### - -###> doctrine/doctrine-bundle ### -# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" -# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls -DATABASE_URL=mysql://root@127.0.0.1/sylius_customer_reorder_plugin_%kernel.environment%?serverVersion=5.5 -###< doctrine/doctrine-bundle ### - -###> symfony/swiftmailer-bundle ### -# For Gmail as a transport, use: "gmail://username:password@localhost" -# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" -# Delivery is disabled by default via "null://localhost" -MAILER_URL=smtp://localhost -###< symfony/swiftmailer-bundle ### diff --git a/tests/Application/.env.test b/tests/Application/.env.test new file mode 100644 index 0000000..08f3df5 --- /dev/null +++ b/tests/Application/.env.test @@ -0,0 +1,3 @@ +APP_SECRET='ch4mb3r0f5ecr3ts' + +KERNEL_CLASS='Tests\Sylius\CustomerReorderPlugin\Application\Kernel' diff --git a/tests/Application/.env.test.dist b/tests/Application/.env.test.dist deleted file mode 100644 index 9a14d99..0000000 --- a/tests/Application/.env.test.dist +++ /dev/null @@ -1,23 +0,0 @@ -# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file -# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. -# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration - -###> symfony/framework-bundle ### -APP_ENV=test -APP_DEBUG=1 -APP_SECRET=EDITME -###< symfony/framework-bundle ### - -###> doctrine/doctrine-bundle ### -# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" -# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls -DATABASE_URL=mysql://root@127.0.0.1/sylius_customer_reorder_plugin_%kernel.environment%?serverVersion=5.5 -###< doctrine/doctrine-bundle ### - -###> symfony/swiftmailer-bundle ### -# For Gmail as a transport, use: "gmail://username:password@localhost" -# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" -# Delivery is disabled by default via "null://localhost" -MAILER_URL=null://localhost -###< symfony/swiftmailer-bundle ### diff --git a/tests/Application/.eslintrc.js b/tests/Application/.eslintrc.js index e5dd80e..92c4cee 100644 --- a/tests/Application/.eslintrc.js +++ b/tests/Application/.eslintrc.js @@ -1,6 +1,13 @@ module.exports = { extends: 'airbnb-base', + env: { + node: true, + }, rules: { + 'object-shorthand': ['error', 'always', { + avoidQuotes: true, + avoidExplicitReturnArrows: true, + }], 'function-paren-newline': ['error', 'consistent'], 'max-len': ['warn', 120, 2, { ignoreUrls: true, diff --git a/tests/Application/.gitignore b/tests/Application/.gitignore index f214117..8ad1225 100644 --- a/tests/Application/.gitignore +++ b/tests/Application/.gitignore @@ -1,17 +1,22 @@ -/var/* -!/var/.gitignore - /public/assets -/public/bundles /public/css /public/js -/public/media +/public/media/* +!/public/media/image/ +/public/media/image/* +!/public/media/image/.gitignore -/vendor /node_modules -/.env -/.env.prod -/.env.staging -/.env.test -/.env.test_cached +###> symfony/framework-bundle ### +/.env.*.local +/.env.local +/.env.local.php +/public/bundles +/var/ +/vendor/ +###< symfony/framework-bundle ### + +###> symfony/web-server-bundle ### +/.web-server-pid +###< symfony/web-server-bundle ### diff --git a/tests/Application/bin/console b/tests/Application/bin/console index e3a42b2..a130114 100755 --- a/tests/Application/bin/console +++ b/tests/Application/bin/console @@ -1,36 +1,31 @@ #!/usr/bin/env php getParameterOption(['--env', '-e'], null, true)) { + putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env); +} - $envFile = file_exists(__DIR__.'/../.env') ? __DIR__.'/../.env' : __DIR__.'/../.env.dist'; - (new Dotenv())->load($envFile); +if ($input->hasParameterOption('--no-debug', true)) { + putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0'); } -$input = new ArgvInput(); -$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev', true); -$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption('--no-debug', true); +require dirname(__DIR__).'/config/bootstrap.php'; -if ($debug) { +if ($_SERVER['APP_DEBUG']) { umask(0000); if (class_exists(Debug::class)) { @@ -38,6 +33,6 @@ if ($debug) { } } -$kernel = new Kernel($env, $debug); +$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); $application = new Application($kernel); $application->run($input); diff --git a/tests/Application/config/bootstrap.php b/tests/Application/config/bootstrap.php new file mode 100644 index 0000000..6bb0207 --- /dev/null +++ b/tests/Application/config/bootstrap.php @@ -0,0 +1,21 @@ +=1.2) +if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) { + $_SERVER += $env; + $_ENV += $env; +} elseif (!class_exists(Dotenv::class)) { + throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); +} else { + // load all the .env files + (new Dotenv())->loadEnv(dirname(__DIR__).'/.env'); +} + +$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; +$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; +$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index b914b94..ad6ce8b 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -53,7 +53,8 @@ Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true], FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true], Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true], + Sylius\CustomerReorderPlugin\SyliusCustomerReorderPlugin::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], - Sylius\CustomerReorderPlugin\SyliusCustomerReorderPlugin::class => ['all' => true], + FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true], ]; diff --git a/tests/Application/config/routes.yaml b/tests/Application/config/routes.yaml index e69de29..6c3338a 100644 --- a/tests/Application/config/routes.yaml +++ b/tests/Application/config/routes.yaml @@ -0,0 +1,2 @@ +sylius_customer_reorder_plugin: + resource: "@SyliusCustomerReorderPlugin/Resources/config/app/reorder_routing.yml" diff --git a/tests/Application/config/routes/sylius_customer_reorder_plugin.yaml b/tests/Application/config/routes/sylius_customer_reorder_plugin.yaml deleted file mode 100644 index 6c3338a..0000000 --- a/tests/Application/config/routes/sylius_customer_reorder_plugin.yaml +++ /dev/null @@ -1,2 +0,0 @@ -sylius_customer_reorder_plugin: - resource: "@SyliusCustomerReorderPlugin/Resources/config/app/reorder_routing.yml" diff --git a/tests/Application/config/services_test.yaml b/tests/Application/config/services_test.yaml new file mode 100644 index 0000000..d9b02e3 --- /dev/null +++ b/tests/Application/config/services_test.yaml @@ -0,0 +1,3 @@ +imports: + - { resource: "../../Behat/Resources/services.xml" } + - { resource: "../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } diff --git a/tests/Application/gulpfile.babel.js b/tests/Application/gulpfile.babel.js index 6a4696b..5920316 100644 --- a/tests/Application/gulpfile.babel.js +++ b/tests/Application/gulpfile.babel.js @@ -3,49 +3,49 @@ import gulp from 'gulp'; import yargs from 'yargs'; const { argv } = yargs - .options({ - rootPath: { - description: ' path to public assets directory', - type: 'string', - requiresArg: true, - required: false, - }, - nodeModulesPath: { - description: ' path to node_modules directory', - type: 'string', - requiresArg: true, - required: false, - }, - }); + .options({ + rootPath: { + description: ' path to public assets directory', + type: 'string', + requiresArg: true, + required: false, + }, + nodeModulesPath: { + description: ' path to node_modules directory', + type: 'string', + requiresArg: true, + required: false, + }, + }); const config = [ - '--rootPath', - argv.rootPath || '../../../../../../../tests/Application/public/assets', - '--nodeModulesPath', - argv.nodeModulesPath || '../../../../../../../tests/Application/node_modules', + '--rootPath', + argv.rootPath || '../../../../../../../tests/Application/public/assets', + '--nodeModulesPath', + argv.nodeModulesPath || '../../../../../../../tests/Application/node_modules', ]; export const buildAdmin = function buildAdmin() { - return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false }) - .pipe(chug({ args: config, tasks: 'build' })); + return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false }) + .pipe(chug({ args: config, tasks: 'build' })); }; buildAdmin.description = 'Build admin assets.'; export const watchAdmin = function watchAdmin() { - return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false }) - .pipe(chug({ args: config, tasks: 'watch' })); + return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false }) + .pipe(chug({ args: config, tasks: 'watch' })); }; watchAdmin.description = 'Watch admin asset sources and rebuild on changes.'; export const buildShop = function buildShop() { - return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false }) - .pipe(chug({ args: config, tasks: 'build' })); + return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false }) + .pipe(chug({ args: config, tasks: 'build' })); }; buildShop.description = 'Build shop assets.'; export const watchShop = function watchShop() { - return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false }) - .pipe(chug({ args: config, tasks: 'watch' })); + return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false }) + .pipe(chug({ args: config, tasks: 'watch' })); }; watchShop.description = 'Watch shop asset sources and rebuild on changes.'; diff --git a/tests/Application/package.json b/tests/Application/package.json index 96afdd8..14072b2 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -1,53 +1,53 @@ { - "dependencies": { - "babel-polyfill": "^6.26.0", - "jquery": "^3.2.0", - "lightbox2": "^2.9.0", - "semantic-ui-css": "^2.2.0" - }, - "devDependencies": { - "babel-core": "^6.26.3", - "babel-plugin-external-helpers": "^6.22.0", - "babel-plugin-module-resolver": "^3.1.1", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-register": "^6.26.0", - "dedent": "^0.7.0", - "eslint": "^4.19.1", - "eslint-config-airbnb-base": "^12.1.0", - "eslint-import-resolver-babel-module": "^4.0.0", - "eslint-plugin-import": "^2.12.0", - "fast-async": "^6.3.7", - "gulp": "^4.0.0", - "gulp-chug": "^0.5", - "gulp-concat": "^2.6.0", - "gulp-debug": "^2.1.2", - "gulp-if": "^2.0.0", - "gulp-livereload": "^3.8.1", - "gulp-order": "^1.1.1", - "gulp-sass": "^4.0.1", - "gulp-sourcemaps": "^1.6.0", - "gulp-uglifycss": "^1.0.5", - "merge-stream": "^1.0.0", - "rollup": "^0.60.7", - "rollup-plugin-babel": "^3.0.4", - "rollup-plugin-commonjs": "^9.1.3", - "rollup-plugin-inject": "^2.0.0", - "rollup-plugin-node-resolve": "^3.3.0", - "rollup-plugin-uglify": "^4.0.0", - "upath": "^1.1.0", - "yargs": "^6.4.0" - }, - "scripts": { - "build": "gulp build", - "gulp": "gulp build", - "lint": "yarn lint:js", - "lint:js": "eslint gulpfile.babel.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Sylius/Sylius.git" - }, - "author": "Paweł Jędrzejewski", - "license": "MIT" + "dependencies": { + "babel-polyfill": "^6.26.0", + "jquery": "^3.2.0", + "lightbox2": "^2.9.0", + "semantic-ui-css": "^2.2.0" + }, + "devDependencies": { + "babel-core": "^6.26.3", + "babel-plugin-external-helpers": "^6.22.0", + "babel-plugin-module-resolver": "^3.1.1", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-register": "^6.26.0", + "dedent": "^0.7.0", + "eslint": "^4.19.1", + "eslint-config-airbnb-base": "^12.1.0", + "eslint-import-resolver-babel-module": "^4.0.0", + "eslint-plugin-import": "^2.12.0", + "fast-async": "^6.3.7", + "gulp": "^4.0.0", + "gulp-chug": "^0.5", + "gulp-concat": "^2.6.0", + "gulp-debug": "^2.1.2", + "gulp-if": "^2.0.0", + "gulp-livereload": "^3.8.1", + "gulp-order": "^1.1.1", + "gulp-sass": "^4.0.1", + "gulp-sourcemaps": "^1.6.0", + "gulp-uglifycss": "^1.0.5", + "merge-stream": "^1.0.0", + "rollup": "^0.60.7", + "rollup-plugin-babel": "^3.0.4", + "rollup-plugin-commonjs": "^9.1.3", + "rollup-plugin-inject": "^2.0.0", + "rollup-plugin-node-resolve": "^3.3.0", + "rollup-plugin-uglify": "^4.0.0", + "upath": "^1.1.0", + "yargs": "^6.4.0" + }, + "scripts": { + "build": "gulp build", + "gulp": "gulp build", + "lint": "yarn lint:js", + "lint:js": "eslint gulpfile.babel.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Sylius/Sylius.git" + }, + "author": "Paweł Jędrzejewski", + "license": "MIT" } diff --git a/tests/Application/public/index.php b/tests/Application/public/index.php index 81f36c9..3cb550e 100644 --- a/tests/Application/public/index.php +++ b/tests/Application/public/index.php @@ -1,42 +1,26 @@ load($envFile); -} -$env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev'; -$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env)); +require dirname(__DIR__).'/config/bootstrap.php'; -if ($debug) { +if ($_SERVER['APP_DEBUG']) { umask(0000); Debug::enable(); } -if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) { +if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) { Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST); } -if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) { - Request::setTrustedHosts(explode(',', $trustedHosts)); +if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) { + Request::setTrustedHosts([$trustedHosts]); } -$kernel = new Kernel($env, $debug); +$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); diff --git a/tests/Application/public/media/image/.gitignore b/tests/Application/public/media/image/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml index a87d110..01ef80a 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -2,32 +2,27 @@ - - - + + + - - - + + - - - - - + + + + - - - diff --git a/tests/Behat/Resources/suites.yml b/tests/Behat/Resources/suites.yml index 5a078f8..0010d77 100644 --- a/tests/Behat/Resources/suites.yml +++ b/tests/Behat/Resources/suites.yml @@ -1,7 +1,7 @@ default: suites: reorders_ui: - contexts_services: + contexts: - sylius_customer_reorder.behat.context.ui.reorder - sylius.behat.context.setup.channel @@ -27,10 +27,12 @@ default: - sylius.behat.context.ui.shop.account - sylius.behat.context.ui.shop.cart - sylius.behat.context.ui.shop.checkout.addressing + filters: tags: "@reordering && @ui" + reorders_application: - contexts_services: + contexts: - sylius_customer_reorder.behat.context.application.reorder - sylius.behat.context.setup.channel @@ -58,5 +60,6 @@ default: - sylius.behat.context.ui.shop.account - sylius.behat.context.ui.shop.cart - sylius.behat.context.ui.shop.checkout.addressing + filters: tags: "@reordering && @application"