You are here

public function DevelCommandsTest::testCommands in Devel 4.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/DevelCommandsTest.php \Drupal\Tests\devel\Functional\DevelCommandsTest::testCommands()
  2. 8.2 tests/src/Functional/DevelCommandsTest.php \Drupal\Tests\devel\Functional\DevelCommandsTest::testCommands()

Tests drush commands.

File

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

Class

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

Namespace

Drupal\Tests\devel\Functional

Code

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