Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated test enviroment and CI for Sylius v1.3
- Loading branch information
Showing
83 changed files
with
961 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<p align="center"> | ||
<a href="https://sylius.com" target="_blank"> | ||
<img src="https://demo.sylius.com/assets/shop/img/logo.png" /> | ||
</a> | ||
</p> | ||
|
||
<h1 align="center">Plugin Skeleton</h1> | ||
|
||
<p align="center">Skeleton for starting Sylius plugins.</p> | ||
|
||
## Installation | ||
|
||
1. Run `composer create-project sylius/plugin-skeleton ProjectName`. | ||
|
||
2. From the plugin skeleton root directory, run the following commands: | ||
|
||
```bash | ||
$ (cd tests/Application && yarn install) | ||
$ (cd tests/Application && yarn build) | ||
$ (cd tests/Application && bin/console assets:install public -e test) | ||
|
||
$ (cd tests/Application && bin/console doctrine:database:create -e test) | ||
$ (cd tests/Application && bin/console doctrine:schema:create -e test) | ||
``` | ||
|
||
## Usage | ||
|
||
### Running plugin tests | ||
|
||
- PHPUnit | ||
|
||
```bash | ||
$ vendor/bin/phpunit | ||
``` | ||
|
||
- PHPSpec | ||
|
||
```bash | ||
$ vendor/bin/phpspec run | ||
``` | ||
|
||
- Behat (non-JS scenarios) | ||
|
||
```bash | ||
$ vendor/bin/behat --tags="~@javascript" | ||
``` | ||
|
||
- Behat (JS scenarios) | ||
|
||
1. Download [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) | ||
|
||
2. Download [Selenium Standalone Server](https://www.seleniumhq.org/download/). | ||
|
||
2. Run Selenium server with previously downloaded Chromedriver: | ||
|
||
```bash | ||
$ java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalone.jar | ||
``` | ||
3. Run test application's webserver on `localhost:8080`: | ||
|
||
```bash | ||
$ (cd tests/Application && bin/console server:run localhost:8080 -d public -e test) | ||
``` | ||
|
||
4. Run Behat: | ||
|
||
```bash | ||
$ vendor/bin/behat --tags="@javascript" | ||
``` | ||
|
||
### Opening Sylius with your plugin | ||
|
||
- Using `test` environment: | ||
|
||
```bash | ||
$ (cd tests/Application && bin/console sylius:fixtures:load -e test) | ||
$ (cd tests/Application && bin/console server:run -d public -e test) | ||
``` | ||
|
||
- Using `dev` environment: | ||
|
||
```bash | ||
$ (cd tests/Application && bin/console sylius:fixtures:load -e dev) | ||
$ (cd tests/Application && bin/console server:run -d public -e dev) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 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=dev | ||
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_%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 ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 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_%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 ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 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_%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 ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
module.exports = { | ||
extends: 'airbnb-base', | ||
rules: { | ||
'function-paren-newline': ['error', 'consistent'], | ||
'max-len': ['warn', 120, 2, { | ||
ignoreUrls: true, | ||
ignoreComments: false, | ||
ignoreRegExpLiterals: true, | ||
ignoreStrings: true, | ||
ignoreTemplateLiterals: true, | ||
}], | ||
}, | ||
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, | ||
ignoreComments: false, | ||
ignoreRegExpLiterals: true, | ||
ignoreStrings: true, | ||
ignoreTemplateLiterals: true, | ||
}], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
/node_modules/ | ||
|
||
/var/* | ||
!/var/.gitkeep | ||
!/var/.gitignore | ||
|
||
/public/assets | ||
/public/bundles | ||
/public/css | ||
/public/js | ||
/public/media | ||
!/public/media/image/.gitignore | ||
|
||
/vendor | ||
/node_modules | ||
|
||
/web/* | ||
!/web/app.php | ||
!/web/app_dev.php | ||
!/web/app_test.php | ||
/.env | ||
/.env.prod | ||
/.env.staging | ||
/.env.test | ||
/.env.test_cached |
Oops, something went wrong.