function DevelHookCommandTest::testInteract

The prompt offers the implementations.

File

tests/src/Kernel/DevelHookCommandTest.php, line 75

Class

DevelHookCommandTest
Tests the devel:hook command.

Namespace

Drupal\Tests\devel\Kernel

Code

public function testInteract() : void {
  $tester = new CommandTester($this->command());
  $tester->setInputs([
    DevelHooks::class . '::help',
  ]);
  $tester->execute([
    'hook' => 'help',
  ], [
    'interactive' => TRUE,
  ]);
  $this->assertSame(Command::SUCCESS, $tester->getStatusCode(), $tester->getDisplay());
  $this->assertStringContainsString('Select the hook implementation', $tester->getDisplay());
  $this->assertStringContainsString((new \ReflectionClass(DevelHooks::class))->getFileName() . ':', $tester->getDisplay());
}