mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 01:31:45 +01:00
Documentation > Development > add commands based on Phing & update whole document
This commit is contained in:
@@ -15,10 +15,10 @@ Development-related information
|
|||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install packages by running command:
|
2. Rebuild project by running command (installs packages, prepares required directories and runs tests):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run composer install
|
docker-compose exec php phing
|
||||||
```
|
```
|
||||||
|
|
||||||
> [What is Docker?](https://www.docker.com/what-docker)
|
> [What is Docker?](https://www.docker.com/what-docker)
|
||||||
@@ -28,7 +28,7 @@ Development-related information
|
|||||||
Available as `composer` service. You can run any Composer's command using the `composer` service:
|
Available as `composer` service. You can run any Composer's command using the `composer` service:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run composer <command>
|
docker-compose run --rm composer [command]
|
||||||
```
|
```
|
||||||
|
|
||||||
Examples below.
|
Examples below.
|
||||||
@@ -36,25 +36,25 @@ Examples below.
|
|||||||
##### Install packages
|
##### Install packages
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run composer install
|
docker-compose run --rm composer install
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Update packages
|
##### Update packages
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run composer update
|
docker-compose run --rm composer update
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Add package
|
##### Add package
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run composer require <vendor>/<package>
|
docker-compose run --rm composer require [vendor]/[package]
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Remove package
|
##### Remove package
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run composer remove <vendor>/<package>
|
docker-compose run --rm composer remove [vendor]/[package]
|
||||||
```
|
```
|
||||||
|
|
||||||
# Coding Standards Fixer
|
# Coding Standards Fixer
|
||||||
@@ -65,6 +65,12 @@ Fix coding standard by running command:
|
|||||||
docker-compose exec php php-cs-fixer fix
|
docker-compose exec php php-cs-fixer fix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose exec php phing -f phing/tests.xml build:fix-coding-standards
|
||||||
|
```
|
||||||
|
|
||||||
Omit cache and run the Fixer from scratch by running command:
|
Omit cache and run the Fixer from scratch by running command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -77,36 +83,34 @@ docker-compose exec php rm .php_cs.cache && docker-compose exec php php-cs-fixer
|
|||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
Install required packages by running command: `docker-compose run composer install`.
|
Install required packages by running command: `docker-compose run --rm composer install`.
|
||||||
|
|
||||||
### Running tests
|
### Running [PHPUnit](https://phpunit.de) tests
|
||||||
|
|
||||||
#### Simply & quick, without code coverage
|
##### Easy (with code coverage)
|
||||||
|
|
||||||
Tests are running using Docker and `php` service defined in `docker-compose.yml`. Example:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose exec php phpunit --no-coverage
|
docker-compose run --rm phpunit --verbose
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also run them in container. In this case you have to run 2 commands:
|
or
|
||||||
1. Enter container:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose exec php bash
|
docker-compose exec php phing -f phing/tests.xml test:phpunit
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Run tests:
|
##### Quick (without code coverage)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
phpunit --no-coverage
|
docker-compose run --rm phpunit --verbose --no-coverage
|
||||||
```
|
```
|
||||||
|
|
||||||
#### With code coverage
|
# Versions of packages
|
||||||
|
|
||||||
```bash
|
### squizlabs/php_codesniffer
|
||||||
docker-compose exec php phpunit
|
|
||||||
```
|
I have to use [squizlabs/php_codesniffer](https://packagist.org/packages/squizlabs/php_codesniffer) `^2.9` instead of
|
||||||
|
`^3.3`, because [Phing doesn't support 3.x PHP_CodeSniffer](https://github.com/phingofficial/phing/issues/716).
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user