Skip to content

Commit

Permalink
Remove copy of Testing file
Browse files Browse the repository at this point in the history
  • Loading branch information
maximehuran committed Nov 3, 2021
1 parent c8a65cf commit 7b57a94
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 93 deletions.
58 changes: 0 additions & 58 deletions TESTING copy.md

This file was deleted.

67 changes: 32 additions & 35 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,58 @@
# Testing

## Installation
## Requirements

1. To be able to run yarn build correctly, create symlink for `node_modules` :
You'll need:

```bash
ln -s tests/Application/node_modules node_modules
```
- PHP 7.4 minimum.
- docker, for the database.
- symfony CLI, to run the local server.
- composer, to install PHP dependencies.
- npm and yarn, to install ui dependencies and build the JS/CSS files.

2. From the plugin root directory, run the following commands:
## Installation

```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)
```
```bash
make install
```

To be able to setup the plugin's database, remember to configure your database credentials in `tests/Application/.env`
and `tests/Application/.env.test`. You can also add custom configuration in `tests/Application/.env.test.local`.
This will run a Sylius app (the one in `tests/Application/`) with the plugin
installed and all Sylius' sample data. It uses the symfony binary.

## Usage

### Running plugin tests
### List all available commands

- PHPUnit
```bash
make help
```

```bash
$ vendor/bin/phpunit
```
### Running minimum plugin tests

- PHPSpec
- PHPUnit

```bash
$ vendor/bin/phpspec run
make test.phpunit
```
- PHPStan

- PHP CS fixer

```bash
$ vendor/bin/phpstan analyse src
make test.phpcs
```

### Opening Sylius with the plugin
> Tip: You can fix your code with `make test.phpcs.fix`!

- Using `test` environment:
- PHPSpec

```bash
$ (cd tests/Application && bin/console sylius:fixtures:load -e test)
$ (cd tests/Application && bin/console server:run -d public -e test)
make test.phpspec
```
- Using `dev` environment:

- PHPStan

```bash
$ (cd tests/Application && bin/console sylius:fixtures:load -e dev)
$ (cd tests/Application && bin/console server:run -d public -e dev)
make test.phpstan
```

> Tip: You can run all tests with `make test.all`!

0 comments on commit 7b57a94

Please sign in to comment.