In previous article, we explained why integration tests will greatly benefit your Drupal automated testing efforts and also announced that we are making Red Test, an integration testing framework for Drupal, open-source. In this article, you'll learn how to install Red Test to get started with your integration tests for Drupal. Here are the steps:
1) Go to your Drupal root and clone the github repository.
git clone https://github.com/redcrackle/tests.git
2) This will create a folder named "tests" in your Drupal root. Change directory into that folder.
3) Install the required software libraries using composer.
php composer.phar install
This command will install RedTest library along with PHPUnit, ParaTest and others.
4) Remove .git folder so that the cloned repo can be committed to your main Drupal application repo.
rm -rf .git
5) The "tests" git repo you cloned already has pre-defined tests that you can run. To run them, change into Drupal root folder and execute the ParaTest command. Make sure to change the --processes argument to 1.5 times the number of processor cores that you system has. The tests will most likely fail since they are for Drupal's standard installation profile and that's fine. You are just one step away from creating your own first test!
cd .. tests/bin/paratest --phpunit=tests/bin/phpunit --processes=4 --no-test-tokens --log-junit="tests/output.xml" --configuration=tests/phpunit.xml