README.txt

  1. 6.x tests/README.txt
  2. 3.x README.txt
  3. 4.x tests/README.txt
  4. 4.x README.txt
  5. 5.x tests/README.txt
  6. 5.x README.txt
  7. 5.x lib/README.txt
Drush's test suite is based on PHPUnit (http://www.phpunit.de/). In order to maintain
high quality, our tests are run on every push - https://travis-ci.org/drush-ops/drush

Usage
--------
- Install PHPUnit [*]
- Review the configuration settings in phpunit.xml.dist. If customization is needed,
  copy to phpunit.xml and edit away.
- Run unit tests [*]

Advanced usage
---------
- Run only tests matching a regex: phpunit --filter=testVersionString .
- Skip slow tests (usually those with network usage): phpunit --exclude-group slow .
- XML results: phpunit --filter=testVersionString --log-junit results.xml .

Reuse by Drush Commandfiles
-----------
Drush commandfiles are encouraged to ship with PHPUnit test cases that
extend Drush_UnitTestCase and Drush_CommandTestCase. In order to run
the tests, you have to point to the /tests/drush_testcase.inc file
such as `phpunit --bootstrap=/path/to/drush/tests/drush_testcase.inc`.
The devel project does exactly this -
http://drupalcode.org/project/devel.git/blob/refs/heads/8.x-1.x:/drush/develDrushTest.php

Cache
-----------
In order to speed up test runs, Unish (the drush testing class) caches built Drupal sites
and restores them as requested by tests. Once in while, you might need to clear this cache
by deleting the <tmp>/drush-cache directory.

[*] Run unit tests:
- From the /tests subdirectory, run phpunit
  $ cd tests
  $ php ../vendor/phpunit/phpunit/phpunit.php .

[*] Install PHPUnit:
---------------
- Follow the installation instruction from
  - http://getcomposer.org/download
- now run composer depending on your installation from the drush root directory
  - php composer.phar install --dev
  - composer install --dev

File

tests/README.txt
View source
  1. Drush's test suite is based on PHPUnit (http://www.phpunit.de/). In order to maintain
  2. high quality, our tests are run on every push - https://travis-ci.org/drush-ops/drush
  3. Usage
  4. --------
  5. - Install PHPUnit [*]
  6. - Review the configuration settings in phpunit.xml.dist. If customization is needed,
  7. copy to phpunit.xml and edit away.
  8. - Run unit tests [*]
  9. Advanced usage
  10. ---------
  11. - Run only tests matching a regex: phpunit --filter=testVersionString .
  12. - Skip slow tests (usually those with network usage): phpunit --exclude-group slow .
  13. - XML results: phpunit --filter=testVersionString --log-junit results.xml .
  14. Reuse by Drush Commandfiles
  15. -----------
  16. Drush commandfiles are encouraged to ship with PHPUnit test cases that
  17. extend Drush_UnitTestCase and Drush_CommandTestCase. In order to run
  18. the tests, you have to point to the /tests/drush_testcase.inc file
  19. such as `phpunit --bootstrap=/path/to/drush/tests/drush_testcase.inc`.
  20. The devel project does exactly this -
  21. http://drupalcode.org/project/devel.git/blob/refs/heads/8.x-1.x:/drush/develDrushTest.php
  22. Cache
  23. -----------
  24. In order to speed up test runs, Unish (the drush testing class) caches built Drupal sites
  25. and restores them as requested by tests. Once in while, you might need to clear this cache
  26. by deleting the <tmp>/drush-cache directory.
  27. [*] Run unit tests:
  28. - From the /tests subdirectory, run phpunit
  29. $ cd tests
  30. $ php ../vendor/phpunit/phpunit/phpunit.php .
  31. [*] Install PHPUnit:
  32. ---------------
  33. - Follow the installation instruction from
  34. - http://getcomposer.org/download
  35. - now run composer depending on your installation from the drush root directory
  36. - php composer.phar install --dev
  37. - composer install --dev