3 namespace Drupal\Tests\Driver;
5 use Drupal\Driver\DrushDriver;
8 * Tests for the Drush driver.
10 class DrushDriverTest extends \PHPUnit_Framework_TestCase {
13 * Tests instantiating the driver with only an alias.
15 public function testWithAlias() {
16 $driver = new DrushDriver('alias');
17 $this->assertEquals('alias', $driver->alias, 'The drush alias was not properly set.');
21 * Tests instantiating the driver with a prefixed alias.
23 public function testWithAliasPrefix() {
24 $driver = new DrushDriver('@alias');
25 $this->assertEquals('alias', $driver->alias, 'The drush alias did not remove the "@" prefix.');
29 * Tests instantiating the driver with only the root path.
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);
39 * Tests instantiating the driver with missing alias and root path.
41 * @expectedException \Drupal\Driver\Exception\BootstrapException
43 public function testWithNeither() {
44 new DrushDriver('', '');