Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 DrupalTestCase.class.php
Octocat-spinner-32 README.txt
Octocat-spinner-32 phpunit.xml.dist
Octocat-spinner-32 upal.mail.inc
Octocat-spinner-32 upal.php
README.txt
Drupal's test suite based on PHPUnit (http://www.phpunit.de/).

FORK NOTE
---------
This fork by New Leaf Digital is a backport to Drupal 6, with a new approach (using an actual test site), and bug fixes.

Blog post about this project is here:
http://benbuckman.net/tech/11/12/unconventional-unit-testing-drupal-6-phpunit-upal-and-jenkins


Usage
--------
- Install PHPUnit (see below)
- Checkout or download a core Drupal that is to be tested.
  -- Map http://upal at to this Drupal in your web server config. If not possible,
     configure UPAL_WEB_URL in phpunit.xml (see Notes).
  -- Create an 'upal' database in mysql.
  -- If your db_url is not mysql://root:@127.0.0.1/upal, configure UPAL_DB_URL in
     phpunit.xml (see Notes).
- From the drupal root directory that is to be tested, run lines like:
    `phpunit --configuration /path/to/upal/phpnuit.xml FilterUnitTestCase modules/filter/filter.test`
    `phpunit --debug --configuration /path/to/upal/phpunit.xml ./modules/blog/blog.test`

Notes
----------
- If customization is needed as per above, Copy phpunit.xml.dist to phpunit.xml and edit.

Install PHPUnit
----------------

Upal requires PHPUnit 3.5 or later; installing with PEAR is easiest.

- On Linux/OSX:
  sudo apt-get install php5-curl php-pear
  sudo pear upgrade --force PEAR
  sudo pear channel-discover pear.phpunit.de
  sudo pear channel-discover components.ez.no
  sudo pear channel-discover pear.symfony-project.com
  sudo pear install --alldeps phpunit/PHPUnit

- On Windows:
Download and save from go-pear.phar http://pear.php.net/go-pear.phar

  php -q go-pear.phar
  pear channel-discover pear.phpunit.de
  pear channel-discover components.ez.no
  pear channel-discover pear.symfony-project.com
  pear install --alldeps phpunit/PHPUnit
Something went wrong with that request. Please try again.