Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Test Suite

Security covered Under active development 1 sites

This module suite helps site administrators test their Drupal codebase. It includes tools for running custom tests, checking code against Drupal standards using PHPCS, and ensuring code quality with PHPStan. It also provides functionality to run unit and functional tests using PHPUnit.

This module is a combination of 5 modules that together let a site admin test their Drupal codebase.

As of 3.0.73-beta1 List Packages is no longer in Testsuite.
List Packages is moving to https://www.drupal.org/project/vulnerability_checker

TestSuite: This the base module and must always be installed for the others to work. Run your own tests that do not require any additional packages. It uses a custom module that you can find in test_module folder. Copy it into the modules/custom folder, erase the .txt on the .info.yml file and enable it. There are example tests in the module.
PHPUnit: Run Unit and Functional phpunit tests on modules and themes to check that the code runs as expected.
PHPcs: Drupal modules have to go through PHPCs testing to insure they are up to Drupal Standards when submitting a module to drupal.org. This module lets you see if there are any of these violations in the code base.
PHPStan: Is another standard to hold your code to ensure that the code base is error free and will run well in the drupal installation.

PLEASE BE ADVISED THAT VERSIONS PRIOR TO 3.0.37-beta1 HAVE A POSSIBLE SECURITY RISK. 3.0.37-beta1 fixes permissions on route by changing 'access site reports' to 'administer site configuration', adds route regex to filter parameters and adds validation on parameters passed to the getStatement and getFileStatment functions to fix the security vulnerability. PLEASE BE ADVISED THAT 3.0.37-beta1 HAS A SECURITY FIX. PLEASE DO NOT USE PRIOR VERSIONS. THANKS.

Installation

https://www.youtube.com/watch?v=ZZdaJ9Shje4
Install using composer.
1) install wikimedia/composer-merge-plugin

composer require wikimedia/composer-merge-plugin

This uses the wikimedia/composer-merge-plugin. Read for more information on installation. Add modules/contrib/testsuite/composer.json or web/modules/contrib/testsuite/composer.json depending on your path.

In your composer.json in the root of your drupal installation add the following code block under extra after the installer-paths section. Depending on the installation you may have to omit the web/ directory.

"merge-plugin": {
   "include": [
        "web/modules/contrib/testsuite/composer.json"
    ],
   "replace": false,
   "ignore-duplicates": true
},

2) install drupal/testsuite

composer require drupal/testsuite

3) run composer update
This will download if not already downloaded all the dev packages needed for testsuite to work.

4) Go to Extend and install all the TestSuite modules.

5) If using PHPUnit got to Configuration -> Test Suite -> PHPUnit Config and adjust variables if needed but at least click save.

6) Go to Reports -> Testsuite and Reports -> Vulnerability Report to build and work with TestSuite.

Requirements

A Drupal site installed via composer.
Installing Drupal with composer. Installing Drupal
A composer.json file will have a require-dev section with all the dev packages needed for phpunit testing. Depending on the Drupal version you are using the phpunit packages versions can vary too. If you need to get a list of the correct packages for your installation you can get them here. Drupal Versions

Drupal 10–11

Ask your assistant about Test Suite

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
127
Tracked since
Jul 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.0.9-beta1 Pre-release 9 Aug 18, 2023
1.0.29-beta1 Pre-release 8 Aug 18, 2023
1.0.28-beta1 Pre-release 8 Aug 18, 2023
1.0.27-beta1 Pre-release 8 Aug 17, 2023
3.0.18-beta1 Pre-release 10–11 Aug 9, 2023
3.0.17-beta1 Pre-release 10–11 Aug 9, 2023
3.0.16-beta1 Pre-release 10–11 Aug 8, 2023
3.0.15-beta1 Pre-release 10–11 Aug 8, 2023
3.0.14-beta1 Pre-release 10–11 Aug 8, 2023
2.0.8-beta1 Pre-release 9 Aug 7, 2023