DevelCommandsTest.php in Devel 4.x
File
tests/src/Functional/DevelCommandsTest.php
View source
<?php
namespace Drupal\Tests\devel\Functional;
use Drupal\Tests\BrowserTestBase;
use Drush\TestTraits\DrushTestTrait;
class DevelCommandsTest extends BrowserTestBase {
use DrushTestTrait;
public static $modules = [
'devel',
];
protected $defaultTheme = 'stark';
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);
}
}