Download the PHP package tuutti/drupal-test-runner without Composer

On this page you can find all versions of the php package tuutti/drupal-test-runner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package drupal-test-runner

Drupal test runner

Tests

Provides a set of tools to make testing Drupal easier.

Requirements

Installation

$ composer global require tuutti/drupal-test-runner ^1.0

This will create drupal-tr executable that works as a wrapper for our make commands. You can either call it directly from composer's binary folder or add composer's global bin dir to your $PATH variable: PATH="$PATH:$HOME/.composer/vendor/bin".

Usage

Available installers:

Setup Drupal

drupal-tr to install Drupal with selected installer (INSTALLER_TYPE)

Run tests

drupal-tr run-tests to run tests with selected test runner (TEST_RUNNER)

Utility tools

drupal-tr run-drush-server to start a drush server listening on DRUPAL_BASE_URL.

Configuration

Variable name Default value Required Description
DRUPAL_DB_URL Y The database url, for example mysql://drupal:drupal@localhost/drupal
INSTALLER_TYPE contrib N The test type (contrib or composer-project)
TEST_RUNNER phpunit N The test runner (phpunit or core)
PHP_BINARY $(which php) N Path to PHP binary
DRUSH $(which drush), fallbacks to vendor/bin/drush N Path to drush binary. If Drush is not found it will be installed with composer
DRUPAL_BASE_URL Fallbacks to SIMPLETEST_BASE_URL if set N The base url (required for functional tests)
SIMPLETEST_BASE_URL N Same as DRUPAL_BASE_URL
TEST_RUNNER_ROOT Defaults to DRUPAL_ROOT N

Contrib installer

Use contrib when testing something that is not packaged with Drupal core, like Drupal modules or themes. Core version is determined by DRUPAL_CORE_VERSION variable and will be installed to given DRUPAL_ROOT using DRUPAL_INSTALL_PROFILE installation profile.

Your DRUPAL_MODULE_PATH (git root by default) will be added to composer.json's repositories automatically and installed with composer require drupal/$DRUPAL_MODULE_NAME. For this to work your package MUST have a composer.json file containing type and name values starting with drupal, for example:

See composer/installers for available types.

NOTE: DRUPAL_ROOT cannot be inside the DRUPAL_MODULE_PATH folder.

Contrib installer configuration

Variable name Default value Required Description
DRUPAL_MODULE_NAME Y The module/theme name
DRUPAL_INSTALL_PROFILE minimal N The install profile used to install Drupal
DRUPAL_ROOT git root/../drupal N The path where Drupal will be installed
DRUPAL_CORE_VERSION 9.0.x N The core version
DRUPAL_MODULE_PATH git root N Path to the module
DRUPAL_TEST_GROUPS $DRUPAL_MODULE_NAME The test groups. A comma separated list of group names (from @group annotation)

Contrib installer Github actions example

.github/workflows/ci.yml:

Contrib installer Gitlab ci example

Composer-project installer

Use composer-project installer to test Drupal sites that can be installed with composer. For example drupal-composer/drupal-project.

Installs Drupal using DRUPAL_INSTALL_PROFILE or existing config when EXISTING_CONFIG is set to true.

Composer-project installer Github actions example

Configuration

Variable name Default value Required Description
DRUPAL_INSTALL_PROFILE minimal N The install profile used to install Drupal
EXISTING_CONFIG false N Installs Drupal using existing configuration
DRUPAL_ROOT git root N The git root
DRUPAL_TEST_GROUPS The test groups. A comma separated list of group names (from @group annotation)

Test runners

phpunit

Uses vendor/bin/phpunit to run tests (default). Attempts to read configuration file from PHPUNIT_CONFIG_FILE.

Variable name Default value Required Description
PHPUNIT_CONFIG_FILE git root/phpunit.xml.dist N Path to phpunit config file
DRUPAL_TESTSUITES N Limit tests to certain types, like unit or kernel
DRUPAL_TEST_GROUPS N The test groups. A comma separated list of group names (from @group annotation)

core

Uses core's core/scripts/run-tests.sh to run tests.

Set TEST_RUNNER=core to use this.

Variable name Default value Required Description
DRUPAL_TESTSUITES N Limit tests to certain types, like PHPUnit-Kernel
DRUPAL_TEST_GROUPS Y The test groups. A comma separated list of group names (from @group annotation)

All versions of drupal-test-runner with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tuutti/drupal-test-runner contains the following files

Loading the files please wait ....