Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Begin by cloning the GitHub repo locally and installing the dependencies with [C

```sh
# Clone the repository + change into the directory
$ git clone https://github.com/stevegrunwell/phpunit-markup-assertions.git \
&& cd phpunit-markup-assertions
git clone https://github.com/stevegrunwell/phpunit-markup-assertions.git \
&& cd phpunit-markup-assertions;

# Install local dependencies
$ composer install
composer install
```


Expand All @@ -23,12 +23,12 @@ Pull requests should be based off the `develop` branch, which represents the cur

To create a new feature branch:

```bash
```sh
# Start on develop, making sure it's up-to-date
$ git checkout develop && git pull
git checkout develop && git pull;

# Create a new branch for your feature
$ git checkout -b feature/my-cool-new-feature
git checkout -b feature/my-cool-new-feature
```

When submitting a new pull request, your `feature/my-cool-new-feature` should be compared against `develop`.
Expand All @@ -38,13 +38,19 @@ When submitting a new pull request, your `feature/my-cool-new-feature` should be

This project uses [the PSR-2 coding standards](http://www.php-fig.org/psr/psr-2/).

Standards are enforced via [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/), which can be run any time with the following:

```sh
composer test:standards
```


### Running unit tests

[PHPUnit](https://phpunit.de/) is included as a development dependency, and should be run regularly. When submitting changes, please be sure to add or update unit tests accordingly. You may run unit tests at any time by running:

```bash
$ composer test
```sh
composer test:unit
```

#### Code coverage
Expand All @@ -53,8 +59,8 @@ $ composer test

To generate a report of code coverage for the current branch, you may run the following Composer script, which will generate an HTML report in `tests/coverage/`:

```bash
$ composer test-coverage
```sh
composer test:coverage
```

Note that [both the Xdebug and tokenizer PHP extensions must be installed and active](https://phpunit.de/manual/current/en/textui.html) on the machine running the tests.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
uses: ramsey/composer-install@v2

- name: Run test suite
run: composer coding-standards
run: composer test:standards
2 changes: 1 addition & 1 deletion .github/workflows/static-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
run: composer test -- --version

- name: Run PHPStan
run: composer static-analysis
run: composer test:analysis
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
uses: ramsey/composer-install@v2

- name: Run test suite
run: composer test
run: composer test:unit
31 changes: 20 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,33 @@
}
},
"scripts": {
"coding-standards": [
"phpcs"
"test": [
"@test:all"
],
"static-analysis": [
"phpstan analyse"
"test:all": [
"@test:unit",
"@test:standards",
"@test:analysis"
],
"test": [
"simple-phpunit --testdox"
"test:analysis": [
"phpstan analyse"
],
"test-coverage": [
"test:coverage": [
"XDEBUG_MODE=coverage ./vendor/bin/simple-phpunit --coverage-html=tests/coverage --colors=always"
],
"test:standards": [
"phpcs"
],
"test:unit": [
"simple-phpunit --testdox"
]
},
"scripts-descriptions": {
"coding-standards": "Check coding standards.",
"static-analysis": "Run static code analysis",
"test": "Run all test suites.",
"test-coverage": "Generate code coverage reports in tests/coverage."
"test:all": "Run all automated tests",
"test:analysis": "Run static code analysis",
"test:coverage": "Generate code coverage reports in tests/coverage.",
"test:standards": "Check coding standards.",
"test:unit": "Run all test suites."
},
"config": {
"preferred-install": "dist",
Expand Down