Skip to content

Commit e1c3af6

Browse files
author
Piotr Mikołajek
authored
Upgrade to sylius/sylius 1.8 (#338)
1 parent d603db3 commit e1c3af6

17 files changed

Lines changed: 110 additions & 223 deletions

.travis.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
language: php
22

3-
dist: trusty
3+
dist: bionic
44

55
sudo: false
66

77
matrix:
88
include:
9-
# Sylius 1.7
9+
# Sylius 1.8
1010
-
1111
php: 7.3
1212
env:
13-
- DEPENDENCY_VERSIONS="sylius/sylius:1.7.*"
13+
- DEPENDENCY_VERSIONS="sylius/sylius:1.8.*"
14+
15+
addons:
16+
chrome: stable
17+
18+
services:
19+
- mysql
1420

1521
cache:
1622
yarn: true
@@ -49,23 +55,23 @@ before_script:
4955

5056
# Download and configure ChromeDriver
5157
- |
52-
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c 2.34)" = "0" ]; then
53-
curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip
58+
export CHROMEDRIVER_STABLE_VERSION=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
59+
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c $CHROMEDRIVER_STABLE_VERSION)" = "0" ]; then
60+
curl https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_STABLE_VERSION/chromedriver_linux64.zip > chromedriver.zip
5461
unzip chromedriver.zip
5562
chmod +x chromedriver
5663
mv chromedriver $SYLIUS_CACHE_DIR
64+
rm chromedriver.zip
5765
fi
58-
5966
# Run ChromeDriver
6067
- $SYLIUS_CACHE_DIR/chromedriver > /dev/null 2>&1 &
6168

6269
# Download and configure Selenium
6370
- |
64-
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.4.0)" = "0" ]; then
65-
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar
71+
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.141.59)" = "0" ]; then
72+
curl https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar > selenium.jar
6673
mv selenium.jar $SYLIUS_CACHE_DIR
6774
fi
68-
6975
# Run Selenium
7076
- java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &
7177

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"league/csv": "^9.1",
1414
"friendsofsymfony/ckeditor-bundle": "^1.1|^2.0",
1515
"stefandoorn/sitemap-plugin": "^1.0",
16-
"sylius/sylius": "^1.7"
16+
"sylius/sylius": "^1.8"
1717
},
1818
"require-dev": {
1919
"behat/behat": "^3.6",
@@ -29,10 +29,10 @@
2929
"lchrusciel/api-test-case": "^3.0",
3030
"matthiasnoback/symfony-config-test": "^3.0",
3131
"phpspec/phpspec": "^6.0",
32-
"phpstan/phpstan-doctrine": "^0.10",
33-
"phpstan/phpstan-shim": "^0.10",
34-
"phpstan/phpstan-symfony": "^0.10",
35-
"phpstan/phpstan-webmozart-assert": "^0.10",
32+
"phpstan/phpstan": "^0.12",
33+
"phpstan/phpstan-doctrine": "^0.12",
34+
"phpstan/phpstan-symfony": "^0.12",
35+
"phpstan/phpstan-webmozart-assert": "^0.12",
3636
"phpunit/phpunit": "^6.5",
3737
"sensiolabs/security-checker": "^5.0",
3838
"sylius-labs/coding-standard": "^3.0",

phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.6/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
7-
bootstrap="vendor/autoload.php">
7+
bootstrap="tests/Application/config/bootstrap.php">
88
<testsuites>
99
<testsuite name="BitBagSyliusCmsPlugin Test Suite">
1010
<directory>tests</directory>
@@ -15,7 +15,7 @@
1515
<server name="KERNEL_CLASS" value="Tests\BitBag\SyliusCmsPlugin\Application\Kernel" />
1616
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true"/>
1717
<server name="EXPECTED_RESPONSE_DIR" value="../Responses/Expected"/>
18-
<env name="DATABASE_URL" value="sqlite:///%kernel.project_dir%/var/data.db" />
1918
<env name="APP_SECRET" value="''" />
19+
<env name="APP_ENV" value="test"/>
2020
</php>
2121
</phpunit>

tests/Api/Sitemap/Provider/SitemapPageControllerApiLocalesTest.php

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

tests/Api/Sitemap/Provider/SitemapSectionControllerApiLocalesTest.php

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

tests/Api/Sitemap/Provider/SitemapSectionControllerApiTest.php

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

tests/Application/.env

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ APP_SECRET=EDITME
1212
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
1313
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
1414
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
15-
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.db
15+
DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment%
1616
###< doctrine/doctrine-bundle ###
1717

1818
###> symfony/swiftmailer-bundle ###
@@ -21,3 +21,9 @@ DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.db
2121
# Delivery is disabled by default via "null://localhost"
2222
MAILER_URL=smtp://localhost
2323
###< symfony/swiftmailer-bundle ###
24+
25+
###> lexik/jwt-authentication-bundle ###
26+
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
27+
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
28+
JWT_PASSPHRASE=YOUR_SECRET_PASSPHRASE
29+
###< lexik/jwt-authentication-bundle ###

tests/Application/.env.test

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@ APP_ENV=test
22
APP_SECRET='ch4mb3r0f5ecr3ts'
33

44
KERNEL_CLASS='Tests\BitBag\SyliusCmsPlugin\Application\Kernel'
5-
DATABASE_URL='sqlite:///%kernel.project_dir%/var/data.db'
5+
DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment%
6+
7+
###> lexik/jwt-authentication-bundle ###
8+
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem
9+
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem
10+
JWT_PASSPHRASE=ALL_THAT_IS_GOLD_DOES_NOT_GLITTER_NOT_ALL_THOSE_WHO_WANDER_ARE_LOST
11+
###< lexik/jwt-authentication-bundle ###

tests/Application/config/bundles.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@
5353
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
5454
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
5555
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],
56-
5756
Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
5857
Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
59-
6058
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
6159
SitemapPlugin\SitemapPlugin::class => ['all' => true],
60+
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
61+
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
62+
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
63+
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
6264
BitBag\SyliusCmsPlugin\BitBagSyliusCmsPlugin::class => ['all' => true],
6365
];

tests/Application/config/packages/_sylius.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ imports:
55
- { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }
66

77
- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
8+
- { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }
89

910
parameters:
1011
sylius_core.public_dir: '%kernel.project_dir%/public'

0 commit comments

Comments
 (0)