Skip to content

Commit 02a83b1

Browse files
committed
Introduce phpt tests in contributing guide
1 parent 4d77037 commit 02a83b1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ To run the tests specific to the use of `PHP_CODESNIFFER_CBF === true`:
399399

400400
### Writing End-to-End Tests
401401

402+
#### Bashunit
403+
402404
Bash-based end-to-end tests can be written using the [Bashunit](https://bashunit.typeddevs.com/) test tooling using version 0.26.0 or higher.
403405

404406
To install bashunit, follow the [installation guide](https://bashunit.typeddevs.com/installation).
@@ -413,6 +415,20 @@ You can then run the bashunit tests on Linux/Mac/WSL, like so:
413415
When writing end-to-end tests, please use fixtures for the "files under scan" to make the tests stable.
414416
These fixtures can be placed in the `tests/EndToEnd/Fixtures` subdirectory.
415417

418+
#### phpt
419+
420+
PHP-based end-to-end tests can be written using the `phpt` format. This is the format that PHP uses for its own tests. We use PHPUnit to run these tests.
421+
422+
```bash
423+
vendor/bin/phpunit -c phpunit-e2e.xml.dist
424+
```
425+
426+
The following resources may be helpful when writing `phpt`-style tests:
427+
428+
* <https://www.phpinternalsbook.com/tests/phpt_file_structure.html>
429+
* <https://php.github.io/php-src/miscellaneous/writing-tests.html>
430+
* <https://dev.to/moxio/start-testing-with-phpt-tests-in-phpunit-2jpg>
431+
* <https://github.com/sebastianbergmann/phpunit-documentation-english/issues/302>
416432

417433
### Submitting Your Pull Request
418434

0 commit comments

Comments
 (0)