digipolisgent / drupal-testsuites
PHPUnit testsuite setup to run only tests within your custom Drupal 8 project files.
Requires
- php: >=7.0
- symfony/phpunit-bridge: ^3.4.3||^4.2
Requires (Dev)
- drupal/core: ^8
- phpunit/phpunit: ~6
This package is auto-updated.
Last update: 2022-09-13 13:14:20 UTC
README
This package contains PHPUnit test suites to be used within a Drupal 8 project.
It contains test suites that scan the modules/custom
and
themes/custom directory
for tests.
Setup
Make sure that the Drupal root directory is within the web
directory of the
repository.
Install the package:
If the used Drupal version is less than 8.8.0:
composer require --dev digipolisgent/drupal-testsuites:^0.1.2
If the used Drupal version is 8.8.0 or greater:
composer require --dev digipolisgent/drupal-testsuites:^0.2
Add/replace the phpunit.xml.dist
file with the
example config file.
Run tests
Run all tests:
vendor/bin/phpunit
Run all tests and generate coverage report in the build/coverage
directory of
the project:
vendor/bin/phpunit --coverage-html ./build/coverage
Run all tests of a single suite:
vendor/bin/phpunit --testsuite SUITE_NAME
The following test suites are available:
unit
: All unit tests.kernel
: All kernel tests.functional
: All functional tests.functional-javascript
: All functional tests that require javascript.
See Types of tests in Drupal 8.
Change log
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.