|
| 1 | +<p align="center"> |
| 2 | + <a href="http://sylius.org" target="_blank"> |
| 3 | + <img src="http://demo.sylius.org/assets/shop/img/logo.png" /> |
| 4 | + </a> |
| 5 | +</p> |
| 6 | +<h1 align="center">Plugin Skeleton</h1> |
| 7 | +<p align="center"> |
| 8 | + <a href="https://packagist.org/packages/sylius/plugin-skeleton" title="License"> |
| 9 | + <img src="https://img.shields.io/packagist/l/sylius/plugin-skeleton.svg" /> |
| 10 | + </a> |
| 11 | + <a href="https://packagist.org/packages/sylius/plugin-skeleton" title="Version"> |
| 12 | + <img src="https://img.shields.io/packagist/v/sylius/plugin-skeleton.svg" /> |
| 13 | + </a> |
| 14 | + <a href="http://travis-ci.org/Sylius/PluginSkeleton" title="Build status"> |
| 15 | + <img src="https://img.shields.io/travis/Sylius/PluginSkeleton/master.svg" /> |
| 16 | + </a> |
| 17 | + <a href="https://scrutinizer-ci.com/g/Sylius/PluginSkeleton/" title="Scrutinizer"> |
| 18 | + <img src="https://img.shields.io/scrutinizer/g/Sylius/PluginSkeleton.svg" /> |
| 19 | + </a> |
| 20 | +</p> |
| 21 | + |
| 22 | +## Installation |
| 23 | + |
| 24 | +1. Run `composer create-project sylius/plugin-skeleton ProjectName`. |
| 25 | + |
| 26 | +2. From the plugin skeleton root directory, run the following commands: |
| 27 | + |
| 28 | + ```bash |
| 29 | + $ (cd tests/Application && yarn install) |
| 30 | + $ (cd tests/Application && yarn run gulp) |
| 31 | + $ (cd tests/Application && bin/console assets:install web -e test) |
| 32 | + |
| 33 | + $ (cd tests/Application && bin/console doctrine:database:create -e test) |
| 34 | + $ (cd tests/Application && bin/console doctrine:schema:create -e test) |
| 35 | + ``` |
| 36 | + |
| 37 | +## Usage |
| 38 | + |
| 39 | +### Running plugin tests |
| 40 | + |
| 41 | + - PHPUnit |
| 42 | + |
| 43 | + ```bash |
| 44 | + $ bin/phpunit |
| 45 | + ``` |
| 46 | + |
| 47 | + - PHPSpec |
| 48 | + |
| 49 | + ```bash |
| 50 | + $ bin/phpspec run |
| 51 | + ``` |
| 52 | + |
| 53 | + - Behat (non-JS scenarios) |
| 54 | + |
| 55 | + ```bash |
| 56 | + $ bin/behat --tags="~@javascript" |
| 57 | + ``` |
| 58 | + |
| 59 | + - Behat (JS scenarios) |
| 60 | + |
| 61 | + 1. Download [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) |
| 62 | + |
| 63 | + 2. Run Selenium server with previously downloaded Chromedriver: |
| 64 | + |
| 65 | + ```bash |
| 66 | + $ bin/selenium-server-standalone -Dwebdriver.chrome.driver=chromedriver |
| 67 | + ``` |
| 68 | + 3. Run test application's webserver on `localhost:8080`: |
| 69 | + |
| 70 | + ```bash |
| 71 | + $ (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d web -e test) |
| 72 | + ``` |
| 73 | + |
| 74 | + 4. Run Behat: |
| 75 | + |
| 76 | + ```bash |
| 77 | + $ bin/behat --tags="@javascript" |
| 78 | + ``` |
| 79 | +
|
| 80 | +### Opening Sylius with your plugin |
| 81 | +
|
| 82 | +- Using `test` environment: |
| 83 | +
|
| 84 | + ```bash |
| 85 | + $ (cd tests/Application && bin/console sylius:fixtures:load -e test) |
| 86 | + $ (cd tests/Application && bin/console server:run -d web -e test) |
| 87 | + ``` |
| 88 | + |
| 89 | +- Using `dev` environment: |
| 90 | +
|
| 91 | + ```bash |
| 92 | + $ (cd tests/Application && bin/console sylius:fixtures:load -e dev) |
| 93 | + $ (cd tests/Application && bin/console server:run -d web -e dev) |
| 94 | + ``` |
0 commit comments