Version 1
[yaffs-website] / vendor / drush / drush / tests / README.md
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 by [Travis](https://travis-ci.org/drush-ops/drush)
3
4 Usage
5 --------
6 1. Review the configuration settings in [tests/phpunit.xml.dist](phpunit.xml.dist). If customization is needed, copy to phpunit.xml and edit away.
7 1. Run unit tests: `unish.sh`
8
9 Advanced usage
10 ---------
11 - Run only tests matching a regex: `unish.sh --filter=testVersionString`
12 - Skip slow tests (usually those with network usage): `unish.sh --exclude-group slow`
13 - XML results: `unish.sh --filter=testVersionString --log-junit results.xml`
14 - Use an alternate version of Drupal: `UNISH_DRUPAL_MAJOR_VERSION=8 unish.sh ...`
15 - Skip teardown (to examine test sites after a failure): `UNISH_DIRTY=1 unish.sh ...`
16
17 Reuse by Drush Commandfiles
18 -----------
19 Drush commandfiles are encouraged to ship with PHPUnit test cases that
20 extend UnitUnishTestCase and CommandUnishTestCase. In order to run
21 the tests, you have to point to the phpunit.xml file that used by Drush.
22 The devel project has a wrapper script which demonstrates this -
23 http://drupalcode.org/project/devel.git/blob/refs/heads/8.x-1.x:/run-tests-drush.sh
24
25 Cache
26 -----------
27 In order to speed up test runs, Unish (the Drush testing class) caches built Drupal sites
28 and restores them as requested by tests. Once in while, you might need to clear this cache
29 by deleting the <tmp>/drush-cache directory.