6 * Base class for Drush unit tests
8 * Those tests will run in a bootstrapped Drush environment
10 * This should be ran in separate processes, which the following
11 * annotation should do in 3.6 and above:
13 * @runTestsInSeparateProcesses
15 abstract class UnitUnishTestCase extends UnishTestCase {
18 * Minimally bootstrap drush
20 * This is equivalent to the level DRUSH_BOOTSTRAP_NONE, as we
21 * haven't run drush_bootstrap() yet. To do anything, you'll need to
22 * bootstrap to some level using drush_bootstrap().
24 * @see drush_bootstrap()
26 public static function setUpBeforeClass() {
27 parent::setUpBeforeClass();
28 require_once(__DIR__ . '/../../includes/preflight.inc');
29 drush_preflight_prepare();
30 // Need to set DRUSH_COMMAND so that drush will be called and not phpunit
31 define('DRUSH_COMMAND', UNISH_DRUSH);
34 public static function tearDownAfterClass() {
35 parent::tearDownAfterClass();
39 function drush_major_version() {
40 return DRUSH_MAJOR_VERSION;