Skip to content

Commit 06df9c0

Browse files
authored
Merge branch '3.0' into fix/silent-assigners
2 parents 9b92f90 + 7b7acb0 commit 06df9c0

151 files changed

Lines changed: 2241 additions & 1179 deletions

File tree

Some content is hidden

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

.travis.yml

Lines changed: 18 additions & 11 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.9
1010
-
1111
php: 7.3
1212
env:
13-
- DEPENDENCY_VERSIONS="sylius/sylius:1.7.*"
13+
- DEPENDENCY_VERSIONS="sylius/sylius:1.9.*"
14+
15+
addons:
16+
chrome: stable
17+
18+
services:
19+
- mysql
1420

1521
cache:
1622
yarn: true
@@ -42,6 +48,7 @@ before_script:
4248
- (cd tests/Application && bin/console ckeditor:install --clear=drop -vvv)
4349
- (cd tests/Application && bin/console assets:install public -vvv)
4450
- (cd tests/Application && bin/console cache:warmup -vvv)
51+
- (cd tests/Application && bin/console sylius:sitemap:generate -vvv)
4552
- (cd tests/Application && yarn build)
4653

4754
# Configure display
@@ -50,23 +57,23 @@ before_script:
5057

5158
# Download and configure ChromeDriver
5259
- |
53-
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c 2.34)" = "0" ]; then
54-
curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip
60+
export CHROMEDRIVER_STABLE_VERSION=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
61+
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c $CHROMEDRIVER_STABLE_VERSION)" = "0" ]; then
62+
curl https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_STABLE_VERSION/chromedriver_linux64.zip > chromedriver.zip
5563
unzip chromedriver.zip
5664
chmod +x chromedriver
5765
mv chromedriver $SYLIUS_CACHE_DIR
66+
rm chromedriver.zip
5867
fi
59-
6068
# Run ChromeDriver
6169
- $SYLIUS_CACHE_DIR/chromedriver > /dev/null 2>&1 &
6270

6371
# Download and configure Selenium
6472
- |
65-
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.4.0)" = "0" ]; then
66-
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar
73+
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.141.59)" = "0" ]; then
74+
curl https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar > selenium.jar
6775
mv selenium.jar $SYLIUS_CACHE_DIR
6876
fi
69-
7077
# Run Selenium
7178
- java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &
7279

@@ -80,5 +87,5 @@ script:
8087
- vendor/bin/phpspec run
8188
- vendor/bin/behat --strict -vvv --no-interaction --tags '~@unstable' || vendor/bin/behat --strict -vvv --no-interaction --rerun --tags '~@unstable'
8289

83-
after_failure:
84-
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"
90+
#after_failure:
91+
# - vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"

UPGRADE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# UPGRADE FROM 2.4 TO 2.5
1+
# UPGRADE FROM 2.4 TO 3.0
22

33
* The `stefandoorn/sitemap-plugin` dependency has been removed, and moved to the `suggest` section of composer.json.
44
If you didn't require this plugin by yourselves, but want to keep the sitemap support, consider requiring it directly in your project as described [here](doc/sitemap.md).
55

6+
* Width and height has been added to image media. Now width and height html tags are generated in shop image.
7+
Read the below changelog first and then migrate your structure using
8+
`bin/console doctrine:migrations:diff && bin/console doctrine:migrations:migrate` commands
9+
610
# UPGRADE FROM 1.0 TO 2.0
711

812
* A lot of database modifications has been made. Read the below changelog first and then migrate your

composer.json

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,37 @@
1212
"php": "^7.3",
1313
"league/csv": "^9.1",
1414
"friendsofsymfony/ckeditor-bundle": "^1.1|^2.0",
15-
"sylius/sylius": "^1.7"
15+
"sylius/sylius": "^1.9"
1616
},
1717
"require-dev": {
18-
"behat/behat": "^3.6",
19-
"behat/mink": "^1.7",
20-
"behat/mink-browserkit-driver": "^1.3",
21-
"behat/mink-extension": "^2.2",
22-
"behat/mink-selenium2-driver": "^1.3",
18+
"behat/behat": "^3.7",
19+
"behat/mink": "^1.8",
20+
"behat/mink-selenium2-driver": "^1.4",
21+
"friends-of-behat/mink-browserkit-driver": "^1.4",
22+
"friends-of-behat/mink-debug-extension": "^2.0",
23+
"friends-of-behat/mink-extension": "^2.4",
2324
"friends-of-behat/page-object-extension": "^0.3",
2425
"friends-of-behat/suite-settings-extension": "^1.0",
25-
"friends-of-behat/symfony-extension": "^2.0",
26-
"friends-of-behat/variadic-extension": "^1.1",
27-
"lakion/mink-debug-extension": "^1.2.3",
28-
"lchrusciel/api-test-case": "^3.0",
29-
"matthiasnoback/symfony-config-test": "^3.0",
30-
"phpspec/phpspec": "^6.0",
31-
"phpstan/phpstan-doctrine": "^0.10",
32-
"phpstan/phpstan-shim": "^0.10",
33-
"phpstan/phpstan-symfony": "^0.10",
34-
"phpstan/phpstan-webmozart-assert": "^0.10",
35-
"phpunit/phpunit": "^6.5",
36-
"sensiolabs/security-checker": "^5.0",
37-
"sylius-labs/coding-standard": "^3.0",
38-
"symfony/browser-kit": "^4.4",
39-
"symfony/debug-bundle": "^4.4",
40-
"symfony/dotenv": "^4.4",
41-
"symfony/intl": "^4.4",
42-
"symfony/web-profiler-bundle": "^4.4",
43-
"symfony/web-server-bundle": "^4.4"
26+
"friends-of-behat/symfony-extension": "^2.1",
27+
"friends-of-behat/variadic-extension": "^1.3",
28+
"friendsofsymfony/oauth-server-bundle": ">2.0.0-alpha.0 ^2.0@dev",
29+
"lchrusciel/api-test-case": "^4.1||^5.0",
30+
"matthiasnoback/symfony-config-test": "^4.0",
31+
"phpspec/phpspec": "^7.0",
32+
"phpstan/phpstan": "^0.12",
33+
"phpstan/phpstan-doctrine": "^0.12.32",
34+
"phpstan/phpstan-symfony": "^0.12.21",
35+
"phpstan/phpstan-webmozart-assert": "^0.12.12",
36+
"phpunit/phpunit": "^8.0||^9.0",
37+
"sylius-labs/coding-standard": "^3.2",
38+
"symfony/browser-kit": "^4.4||^5.2",
39+
"symfony/debug-bundle": "^4.4||^5.2",
40+
"symfony/dotenv": "^4.4||^5.2",
41+
"symfony/intl": "^4.4||^5.2",
42+
"symfony/web-profiler-bundle": "^4.4||^5.2"
43+
},
44+
"suggest": {
45+
"stefandoorn/sitemap-plugin": "^2.0@alpha"
4446
},
4547
"suggest": {
4648
"stefandoorn/sitemap-plugin": "Adds CMS pages & sections support to the Sylius sitemap plugin"
@@ -60,6 +62,9 @@
6062
}
6163
},
6264
"autoload-dev": {
65+
"psr-4": {
66+
"spec\\BitBag\\SyliusCmsPlugin\\": "spec/"
67+
},
6368
"classmap": ["tests/Application/Kernel.php"]
6469
}
6570
}

doc/installation.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ return [
99
...
1010

1111
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], // WYSIWYG editor
12-
SitemapPlugin\SitemapPlugin::class => ['all' => true], // Sitemap support
1312
BitBag\SyliusCmsPlugin\BitBagSyliusCmsPlugin::class => ['all' => true],
1413
];
1514
```
@@ -53,6 +52,24 @@ Import routing in your `config/routes.yaml` file:
5352
bitbag_sylius_cms_plugin:
5453
resource: "@BitBagSyliusCmsPlugin/Resources/config/routing.yml"
5554
```
55+
If You have installed https://github.com/stefandoorn/sitemap-plugin according to its installation instructions
56+
import optional sitemap providers:
57+
```yaml
58+
# config/services.yaml
59+
...
60+
imports:
61+
...
62+
- { resource: "@BitBagSyliusCmsPlugin/Resources/config/services/sitemap_provider.yml" }
63+
```
64+
65+
and plugin dependency to your `config/bundles.php` file:
66+
```php
67+
return [
68+
...
69+
70+
SitemapPlugin\SitemapPlugin::class => ['all' => true], // Sitemap support
71+
];
72+
```
5673

5774
Finish the installation by updating the database schema and installing assets:
5875
```

doc/sitemap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This plugin suggests to install the Sylius sitemap plugin. The plugin is not installed automatically, but to install run:
44

55
```bash
6-
$ composer require stefandoorn/sitemap-plugin
6+
$ composer require stefandoorn/sitemap-plugin ^2.0@alpha
77
```
88

99
It's already configured after installation and contains a page & section provider.

features/admin/adding_page.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ Feature: Adding new page
3232

3333
@ui @javascript
3434
Scenario: Adding page with page image
35+
And there is an existing "image" media with "aston-martin" code
3536
When I go to the create page page
3637
And I fill the code with "aston_martin_is_amazing_car"
3738
And I fill the slug with "aston_martin_is_amazing_car"
3839
And I fill the name with "Aston Martin is amazing car"
3940
And I fill the meta keywords with "Aston Martin is amazing car"
4041
And I fill the meta description with "Aston Martin is amazing car for this summer."
4142
And I fill the content with "Aston Martin is amazing car for this summer. Buy it."
42-
And I upload the "aston_martin_db_11.jpg" image
43+
And I choose "aston-martin" media as image
4344
And I add it
4445
Then I should be notified that the page has been created
4546

features/admin/managing_pages.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ Feature: Managing cms pages
3333
@ui
3434
Scenario: Updating page with image
3535
Given there is a page in the store
36+
And there is an existing "image" media with "aston-martin" code
3637
When I want to edit this page
3738
And I fill "Code, Content" fields
38-
And I upload the "aston_martin_db_11.jpg" image
39+
And I choose "aston-martin" media as image
3940
And I update it
4041
Then I should be notified that the page was updated

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>

spec/Entity/PageImageSpec.php

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

spec/Entity/PageTranslationSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace spec\BitBag\SyliusCmsPlugin\Entity;
1414

15-
use BitBag\SyliusCmsPlugin\Entity\PageImageInterface;
15+
use BitBag\SyliusCmsPlugin\Entity\MediaInterface;
1616
use BitBag\SyliusCmsPlugin\Entity\PageTranslation;
1717
use BitBag\SyliusCmsPlugin\Entity\PageTranslationInterface;
1818
use PhpSpec\ObjectBehavior;
@@ -37,7 +37,7 @@ function it_implements_page_translation_interface(): void
3737
$this->shouldHaveType(TranslationInterface::class);
3838
}
3939

40-
function it_allows_access_via_properties(PageImageInterface $pageImage): void
40+
function it_allows_access_via_properties(MediaInterface $pageImage): void
4141
{
4242
$this->setName('Homepage');
4343
$this->getName()->shouldReturn('Homepage');

0 commit comments

Comments
 (0)