function DevelHookCommandTest::testImplementation

An implementation is found by module name or by method name.

File

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

Class

DevelHookCommandTest
Tests the devel:hook command.

Namespace

Drupal\Tests\devel\Kernel

Code

public function testImplementation() : void {
  $method = new \ReflectionMethod(DevelHooks::class, 'help');
  $expected = $method->getFileName() . ':' . $method->getStartLine();
  $tester = $this->runCommand([
    'hook' => 'help',
    'implementation' => 'devel',
  ]);
  $this->assertSame($expected, trim($tester->getDisplay()));
  $tester = $this->runCommand([
    'hook' => 'help',
    'implementation' => DevelHooks::class . '::help',
  ]);
  $this->assertSame($expected, trim($tester->getDisplay()));
}