Yaffs site version 1.1
[yaffs-website] / vendor / drush / drush / tests / Unish / UnitUnishTestCase.php
1 <?php
2
3 namespace Unish;
4
5 /**
6  * Base class for Drush unit tests
7  *
8  * Those tests will run in a bootstrapped Drush environment
9  *
10  * This should be ran in separate processes, which the following
11  * annotation should do in 3.6 and above:
12  *
13  * @runTestsInSeparateProcesses
14  */
15 abstract class UnitUnishTestCase extends UnishTestCase {
16
17   /**
18    * Minimally bootstrap drush
19    *
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().
23    *
24    * @see drush_bootstrap()
25    */
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);
32   }
33
34   public static function tearDownAfterClass() {
35     parent::tearDownAfterClass();
36     \drush_postflight();
37   }
38
39   function drush_major_version() {
40     return DRUSH_MAJOR_VERSION;
41   }
42 }