torotil/upal

PHPUnit integeration for Drupal

2.0.0-RC2 2020-12-10 18:49 UTC

This package is auto-updated.

Last update: 2024-04-11 02:12:11 UTC


README

A group of classes used to help run tests using PHPUnit in Drupal.

upal assumes that tests are allowed to modify the database.

Usage

Configuration

By default the configuration is read from UPAL_* environment variables. If that’s fine for you only need to ensure that upal’s classes are autoloadable.

Configuration can be loaded from array or file (YAML, XML, etc). upal uses this config library: https://github.com/hassankhan/config.

Example bootstrap.php

$config = new Upal\Config();
$config->set('drush', '/path/to/drush');
$config->set('drupal_root', '/path/to/drupal/root');
Upal\DrupalBootstrap::$config = $config;

Config Defaults

  • drush: UPAL_DRUSH, trim(which drush)
  • root: UPAL_ROOT, realpath('.')
  • web_url: UPAL_WEB_URL, 'http://upal'
  • tmp: UPAL_TMP, sys_get_temp_dir()