Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit d8aa351

Browse files
committed
Use composer scripts for tests, CS checks
1 parent f95d9fc commit d8aa351

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ install:
2828
- composer info -i
2929

3030
script:
31-
- ./vendor/bin/phpunit
32-
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/phpcs ; fi
31+
- composer test
32+
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs ; fi
3333

3434
notifications:
3535
email: true

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ To run tests:
5454

5555
If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
5656

57-
- Run the tests via `phpunit` and the provided PHPUnit config, like in this example:
57+
- Run the tests using the "test" command shipped in the `composer.json`:
5858

5959
```console
60-
$ ./vendor/bin/phpunit
60+
$ composer test
6161
```
6262

63-
You can turn on conditional tests with the phpunit.xml file.
63+
You can turn on conditional tests with the `phpunit.xml` file.
6464
To do so:
6565

6666
- Copy `phpunit.xml.dist` file to `phpunit.xml`
@@ -69,24 +69,23 @@ To do so:
6969

7070
## Running Coding Standards Checks
7171

72-
This component uses [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for coding
73-
standards checks, and provides configuration for our selected checks.
74-
`phpcs` is installed by default via Composer.
72+
First, ensure you've installed dependencies via composer, per the previous
73+
section on running tests.
7574

76-
To run checks only:
75+
To run CS checks only:
7776

7877
```console
79-
$ ./vendor/bin/phpcs
78+
$ composer cs
8079
```
8180

82-
`phpcs` also includes a tool for fixing most CS violations, `phpcbf`:
81+
To attempt to automatically fix common CS issues:
8382

8483

8584
```console
86-
$ ./vendor/bin/phpcbf
85+
$ composer cs-fix
8786
```
8887

89-
If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure
88+
If the above fixes any CS issues, please re-run the tests to ensure
9089
they pass, and make sure you add and commit the changes after verification.
9190

9291
## Recommended Workflow for Contributions
@@ -219,3 +218,4 @@ repository, we suggest doing some cleanup of these branches.
219218
```console
220219
$ git push {username} :<branchname>
221220
```
221+

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,14 @@
4747
"mouf/pimple-interop": "^1.0 to use Pimple for dependency injection",
4848
"aura/di": "3.0.*@beta to make use of Aura.Di dependency injection container",
4949
"zendframework/zend-expressive": "^1.0 if you wish to use the ApplicationUrlDelegatorFactory"
50+
},
51+
"scripts": {
52+
"check": [
53+
"@cs",
54+
"@test"
55+
],
56+
"cs": "phpcs",
57+
"cs-fix": "phpcbf",
58+
"test": "phpunit"
5059
}
5160
}

0 commit comments

Comments
 (0)