Skip to content

Commit

Permalink
Merge pull request #3 from synolia/improve-doc
Browse files Browse the repository at this point in the history
Improve documentation
  • Loading branch information
oallain authored Jul 8, 2021
2 parents fd3f5dd + e6b5414 commit cbf7b3e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 41 deletions.
55 changes: 15 additions & 40 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

From the plugin root directory, run the following commands:

```bash
$ composer install
$ (cd tests/Application && yarn install)
$ (cd tests/Application && yarn build)
$ (cd tests/Application && APP_ENV=test bin/console assets:install public)

$ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create)
$ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
```
```bash
$ make install -e SYLIUS_VERSION=XX SYMFONY_VERSION=YY
```

Default values : XX=1.9.0 and YY=5.2

To be able to setup this plugin database, remember to configure you database credentials
in `tests/Application/.env` and `tests/Application/.env.test`.
in `install/Application/.env.local` and `install/Application/.env.test.local`.

To reset test environment:
```bash
$ make reset
```

## Usage

Expand All @@ -23,51 +24,25 @@ in `tests/Application/.env` and `tests/Application/.env.test`.

GrumPHP is executed by the Git pre-commit hook, but you can launch it manualy with :
```bash
$ vendor/bin/grumphp run
$ make grumphp
```

- Behat (non-JS scenarios)
- PHPUnit

```bash
$ vendor/bin/behat --tags="~@javascript"
$ make phpunit
```

- 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 && APP_ENV=test bin/console sylius:fixtures:load)
$ (cd tests/Application && APP_ENV=test bin/console server:run -d public)
```

- Using `dev` environment:

```bash
$ (cd tests/Application && APP_ENV=dev bin/console sylius:fixtures:load)
$ (cd tests/Application && APP_ENV=dev bin/console server:run -d public)
```
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ phpunit-configure:
phpunit-run:
cd ${TEST_DIRECTORY} && ./vendor/bin/phpunit

grumphp:
vendor/bin/grumphp run

help: SHELL=/bin/bash
help: ## Dislay this help
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?##.*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[![License](https://img.shields.io/packagist/l/synolia/sylius-maintenance-plugin.svg)](https://github.com/synolia/SyliusMaintenancePlugin/blob/master/LICENSE)
[![CI](https://github.com/synolia/SyliusMaintenancePlugin/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/synolia/SyliusMaintenancePlugin/actions/workflows/ci.yaml)
[![Version](https://img.shields.io/packagist/v/synolia/sylius-maintenance-plugin.svg)](https://packagist.org/packages/synolia/sylius-maintenance-plugin)
[![Total Downloads](https://poser.pugx.org/synolia/sylius-maintenance-plugin/downloads)](https://packagist.org/packages/synolia/sylius-maintenance-plugin)

<p align="center">
<a href="https://sylius.com" target="_blank">
<img src="https://demo.sylius.com/assets/shop/img/logo.png" />
Expand All @@ -6,7 +11,6 @@

<h1 align="center">Sylius Maintenance Plugin</h1>


## Features

### When your website is under maintenance, and you want to :
Expand Down

0 comments on commit cbf7b3e

Please sign in to comment.