fix phpunit command

This commit is contained in:
Dennis Eichhorn 2023-10-22 16:42:14 +00:00
parent 4b8673175e
commit 7d85e108fd

View File

@ -143,11 +143,18 @@ php vendor/bin/phpunit -c tests/PHPUnit/phpunit_no_coverage.xml
In order to also create a code coverage report run: In order to also create a code coverage report run:
```sh ```sh
php -dxdebug.remote_enable=1 -dxdebug.mode=coverage,develop vendor/bin/phpunit -c tests/phpunit_default.xml --log-junit Build/test/junit_php.xml --coverage-html Build/coverage php -dxdebug.mode=coverage,develop vendor/bin/phpunit -c tests/phpunit_default.xml --log-junit Build/test/junit_php.xml --coverage-html Build/coverage
``` ```
A visualization of the coverage can be found at http://127.0.0.1/Build/coverage A visualization of the coverage can be found at http://127.0.0.1/Build/coverage
If you would like to run a individual test suit run:
```sh
php -dxdebug.remote_enable=1 -dxdebug.start_with_request=yes -dxdebug.mode=coverage,develop vendor/bin/phpunit tests/MyTest.php
```
#### Modules #### Modules
Every module needs to have a `Admin` directory containing a class called `AdminTest.php` which is used for testing the installation, activation, deactivation, uninstall and remove of the module. Tests that install, update, remove etc. a module need to have a group called `admin`. After running the `AdminTest.php` test the final state of the module should be installed and active, only this way it's possible to further test the controller and models. A code coverage of at least 90% is mandatory for every module for integration. Every module needs to have a `Admin` directory containing a class called `AdminTest.php` which is used for testing the installation, activation, deactivation, uninstall and remove of the module. Tests that install, update, remove etc. a module need to have a group called `admin`. After running the `AdminTest.php` test the final state of the module should be installed and active, only this way it's possible to further test the controller and models. A code coverage of at least 90% is mandatory for every module for integration.