public function commandCase::testInvoke

8.0.x commandTest.php public commandCase::testInvoke()
6.x commandTest.php public commandCase::testInvoke()
7.x commandTest.php public commandCase::testInvoke()
4.x commandTest.php public commandCase::testInvoke()
5.x commandTest.php public commandCase::testInvoke()
master commandTest.php public commandCase::testInvoke()

File

tests/commandTest.php, line 4

Class

commandCase

Code

public function testInvoke() {
  $expected = array(
    'unit_drush_init',
    'drush_unit_invoke_init',
    'drush_unit_invoke_validate',
    'drush_unit_pre_unit_invoke',
    'drush_unit_invoke',
    'drush_unit_post_unit_invoke',
    'drush_unit_post_unit_invoke_rollback',
    'drush_unit_pre_unit_invoke_rollback',
    'drush_unit_invoke_validate_rollback',
  );

  // We expect a return code of 1 so just call execute() directly.
  $exec = sprintf('%s unit-invoke --include=%s', UNISH_DRUSH, self::escapeshellarg(dirname(__FILE__)));
  $this->execute($exec, self::EXIT_ERROR);
  $called = json_decode($this->getOutput());
  $this->assertSame($expected, $called);
}