digipolisgent/drupal-testsuites

This package is abandoned and no longer maintained. No replacement package was suggested.

PHPUnit testsuite setup to run only tests within your custom Drupal 8 project files.

0.2.0 2019-12-13 07:27 UTC

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.

License PHP from Packagist Maintainability

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.