public function commandUnitCase::testGetCommands

8.0.x commandUnitTest.php public commandUnitCase::testGetCommands()
6.x commandUnitTest.php public commandUnitCase::testGetCommands()
7.x commandUnitTest.php public commandUnitCase::testGetCommands()
5.x commandUnitTest.php public commandUnitCase::testGetCommands()
master commandUnitTest.php public commandUnitCase::testGetCommands()

File

tests/commandUnitTest.php, line 43

Class

commandUnitCase

Code

public function testGetCommands() {
  drush_bootstrap(DRUSH_BOOTSTRAP_DRUSH);
  $commands = drush_get_commands();
  $command = $commands['dl'];

  $this->assertEquals('dl', current($command['aliases']));
  $this->assertArrayHasKey('version_control', $command['engines']);
  $this->assertArrayHasKey('package_handler', $command['engines']);
  $this->assertArrayHasKey('release_info', $command['engines']);
  $this->assertEquals('pm-download', $command['command']);
  $this->assertEquals('pm', $command['commandfile']);
  $this->assertEquals('drush_command', $command['callback']);
  $this->assertArrayHasKey('examples', $command['sections']);
  $this->assertTrue($command['is_alias']);

  $command = $commands['pm-download'];
  $this->assertArrayNotHasKey('is_alias', $command);
}