You are here

public function TargetTest::testExecuteHook in Drupal 7 to 8/9 Module Upgrader 8

File

tests/src/Unit/TargetTest.php, line 97

Class

TargetTest
@group DMU

Namespace

Drupal\Tests\drupalmoduleupgrader\Unit

Code

public function testExecuteHook() {
  $expected = [
    'foo/baz' => [
      'title' => 'It worked!',
    ],
  ];
  $this->indexer
    ->method('has')
    ->with('hook_menu')
    ->willReturn(TRUE);
  $this->indexer
    ->method('hasExecutable')
    ->with('hook_menu')
    ->willReturn(TRUE);
  $this->indexer
    ->method('execute')
    ->with('hook_menu')
    ->willReturn($expected);
  $actual = $this->target
    ->executeHook('menu');
  $this
    ->assertInternalType('array', $actual);
  $this
    ->assertSame($expected, $actual);
}