function DevelCommandsTest::testCommands

Same name in other branches
  1. 4.x tests/src/Functional/DevelCommandsTest.php \Drupal\Tests\devel\Functional\DevelCommandsTest::testCommands()

Tests drush commands.

File

tests/src/Functional/DevelCommandsTest.php, line 36

Class

DevelCommandsTest
@coversDefaultClass \Drupal\devel\Drush\Commands\DevelCommands @group devel

Namespace

Drupal\Tests\devel\Functional

Code

public function testCommands() : void {
    $this->drush(DevelCommands::TOKEN, [], [
        'format' => 'json',
    ]);
    $output = $this->getOutputFromJSON();
    $tokens = array_column($output, 'token');
    $this->assertContains('account-name', $tokens);
    $this->drush(DevelCommands::SERVICES, [], [
        'format' => 'json',
    ]);
    $output = $this->getOutputFromJSON();
    $this->assertContains('current_user', $output);
}