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 9

Namespace

Unish

Class

commandCase
@group base

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_primary',
    
    // Primary callback is not invoked when command specifies a 'callback'.
    // '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',
  );

  $options = array(
    'include' => dirname(__FILE__),
  );
  $this->drush('unit-invoke', array(), $options, NULL, NULL, self::EXIT_ERROR);
  $called = $this->getOutputFromJSON();
  $this->assertSame($expected, $called);
}