Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / tests / Drupal / Tests / Driver / DrushDriverTest.php
1 <?php
2
3 namespace Drupal\Tests\Driver;
4
5 use Drupal\Driver\DrushDriver;
6
7 /**
8  * Tests for the Drush driver.
9  */
10 class DrushDriverTest extends \PHPUnit_Framework_TestCase {
11
12   /**
13    * Tests instantiating the driver with only an alias.
14    */
15   public function testWithAlias() {
16     $driver = new DrushDriver('alias');
17     $this->assertEquals('alias', $driver->alias, 'The drush alias was not properly set.');
18   }
19
20   /**
21    * Tests instantiating the driver with a prefixed alias.
22    */
23   public function testWithAliasPrefix() {
24     $driver = new DrushDriver('@alias');
25     $this->assertEquals('alias', $driver->alias, 'The drush alias did not remove the "@" prefix.');
26   }
27
28   /**
29    * Tests instantiating the driver with only the root path.
30    */
31   public function testWithRoot() {
32     // Bit of a hack here to use the path to this file, but all the driver cares
33     // about during initialization is that the root be a directory.
34     $driver = new DrushDriver('', __FILE__);
35     $this->assertEquals(__FILE__, $driver->root);
36   }
37
38   /**
39    * Tests instantiating the driver with missing alias and root path.
40    *
41    * @expectedException \Drupal\Driver\Exception\BootstrapException
42    */
43   public function testWithNeither() {
44     new DrushDriver('', '');
45   }
46
47 }