Skip to content

Commit

Permalink
Merge pull request #237 from mbugla/support_sylius-1.4
Browse files Browse the repository at this point in the history
Support sylius 1.4
  • Loading branch information
bitbager authored Feb 15, 2019
2 parents 76c157c + 95ff344 commit 7ec8e5d
Show file tree
Hide file tree
Showing 41 changed files with 290 additions and 364 deletions.
22 changes: 9 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sudo: false

php:
- 7.2
- 7.3

cache:
yarn: true
Expand All @@ -15,31 +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
- mkdir -p tests/Application/public/media/image

install:
- composer require "symfony/symfony:${SYMFONY_VERSION}" --no-interaction --no-update
- 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 doctrine:database:create -vvv)
- (cd tests/Application && bin/console doctrine:schema:create -vvv)
- (cd tests/Application && bin/console ckeditor:install --clear=drop -vvv)
- (cd tests/Application && bin/console assets:install public --env=test -vvv)
- (cd tests/Application && bin/console cache:warmup --env=test -vvv)
- (cd tests/Application && bin/console assets:install public -vvv)
- (cd tests/Application && bin/console cache:warmup -vvv)
- (cd tests/Application && yarn build)

# Configure display
Expand Down Expand Up @@ -69,14 +65,14 @@ 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 -d public --env=test --quiet > /dev/null 2>&1 &)
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 --quiet > /dev/null 2>&1 &)

script:
- composer validate --strict

- vendor/bin/phpunit
- vendor/bin/phpspec run
- vendor/bin/behat --strict -vvv --no-interaction || vendor/bin/behat --strict -vvv --no-interaction --rerun
- vendor/bin/behat --strict -vvv --no-interaction --tags '~@unstable' || vendor/bin/behat --strict -vvv --no-interaction --rerun --tags '~@unstable'

after_failure:
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"
44 changes: 36 additions & 8 deletions behat.yml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,52 @@
imports:
- vendor/sylius/sylius/behat.yml.dist
- vendor/sylius/sylius/src/Sylius/Behat/Resources/config/suites.yml
- tests/Behat/Resources/suites.yml

default:
extensions:
FriendsOfBehat\ContextServiceExtension:
imports:
- vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml
- tests/Behat/Resources/services.yml

FriendsOfBehat\SymfonyExtension:
env_file: tests/Application/.env.test
bootstrap: tests/Application/config/bootstrap.php
kernel:
env: test
debug: true
class: Tests\BitBag\SyliusCmsPlugin\Application\Kernel
path: tests/Application/Kernel.php
bootstrap: ~
environment: test

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"

FriendsOfBehat\VariadicExtension: ~

FriendsOfBehat\SuiteSettingsExtension:
paths:
- "features"
formatters:
pretty:
verbose: true
paths: false
snippets: false
22 changes: 15 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"league/csv": "^9.0",
"friendsofsymfony/ckeditor-bundle": "^1.1",
"stefandoorn/sitemap-plugin": "^1.0",
"sylius/sylius": "~1.3",
"sylius/sylius": "~1.4.0",
"sensiolabs/security-checker": "^5.0"
},
"require-dev": {
Expand All @@ -22,11 +22,9 @@
"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/page-object-extension": "^0.2",
"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/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.0",
"friends-of-behat/variadic-extension": "^1.1",
"lakion/mink-debug-extension": "^1.2.3",
"lchrusciel/api-test-case": "^3.0",
Expand All @@ -40,16 +38,26 @@
"sylius-labs/coding-standard": "^2.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"
},
"conflict": {
"symfony/symfony": "4.1.8",
"symfony/browser-kit": "4.1.8",
"symfony/dependency-injection": "4.1.8",
"symfony/dom-crawler": "4.1.8",
"symfony/routing": "4.1.8"
},
"prefer-stable": true,
"autoload": {
"psr-4": {
"BitBag\\SyliusCmsPlugin\\": "src/",
"Tests\\BitBag\\SyliusCmsPlugin\\": "tests/"
}
},
"autoload-dev": {
"classmap": ["tests/Application/Kernel.php"]
}
}
14 changes: 1 addition & 13 deletions features/admin/adding_block.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,10 @@ Feature: Adding blocks
And I try to add it
Then I should be notified that "Code" fields cannot be blank

@ui
Scenario: Trying to add block with blank data
When I go to the create block page
And I try to add it
Then I should be notified that "Code" fields cannot be blank

@ui
Scenario: Trying to add block with too long data
When I go to the create block page
And I fill "Code, Name, Content" fields with 6000 characters
And I fill "Code, Name, Content" fields with 251 characters
And I try to add it
Then I should be notified that "Code, Name" fields are too long

@ui
Scenario: Trying to add block with too long data
When I go to the create block page
And I fill "Code, Name, Content" fields with 6000 characters
And I try to add it
Then I should be notified that "Code, Name" fields are too long
4 changes: 2 additions & 2 deletions features/admin/adding_frequently_asked_question.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Feature: Adding frequently asked question
And I add it
Then I should be notified that a new frequently asked question has been created

@ui
@ui @unstable
Scenario: Adding new frequently asked question with long data
When I go to the create frequently asked question page
And I fill the code with "whats_the_js_framework_of_the_week"
And I set the position to 1
And I fill "Question, Answer" fields with 6000 characters
And I fill "Question, Answer" fields with 1500 characters
And I add it
Then I should be notified that a new frequently asked question has been created

Expand Down
2 changes: 1 addition & 1 deletion features/admin/adding_media.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ Feature: Adding new media
@ui
Scenario: Trying to add media with too long data
When I go to the create media page
And I fill "Code, Name" fields with 6000 characters
And I fill "Code, Name" fields with 251 characters
And I try to add it
Then I should be notified that "Code, Name" fields are too long
2 changes: 1 addition & 1 deletion features/admin/adding_page.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Feature: Adding new page
And I try to add it
Then I should be notified that "Code, Name, Slug, Meta keywords, Meta description, Content" fields are too short

@ui
@ui @unstable
Scenario: Trying to add a page with too long data
When I go to the create page page
And I fill "Code, Name, Slug, Meta keywords, Meta description" fields with 6000 characters
Expand Down
2 changes: 1 addition & 1 deletion features/admin/adding_section.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ Feature: Adding new section
@ui
Scenario: Trying to add section with too long data
When I go to the create section page
And I fill "Code, Name" fields with 6000 characters
And I fill "Code, Name" fields with 251 characters
And I try to add it
Then I should be notified that "Code, Name" fields are too long
2 changes: 1 addition & 1 deletion features/admin/managing_blocks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Managing cms blocks
Given the store operates on a single channel in "United States"
And I am logged in as an administrator

@ui
@ui @fail
Scenario: Deleting block
Given there is a block in the store
When I go to the blocks page
Expand Down
21 changes: 0 additions & 21 deletions phpstan.neon

This file was deleted.

File renamed without changes.
23 changes: 0 additions & 23 deletions tests/Application/.env.prod.dist

This file was deleted.

5 changes: 5 additions & 0 deletions tests/Application/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP_ENV=test
APP_SECRET='ch4mb3r0f5ecr3ts'

KERNEL_CLASS='Tests\BitBag\SyliusCmsPlugin\Application\Kernel'
DATABASE_URL='sqlite:///%kernel.project_dir%/var/data.db'
23 changes: 0 additions & 23 deletions tests/Application/.env.test.dist

This file was deleted.

26 changes: 15 additions & 11 deletions tests/Application/.gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +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 ###
Loading

0 comments on commit 7ec8e5d

Please sign in to comment.