You are here

protected function PermissionHandlerTest::mockModuleExtension in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\PermissionHandlerTest::mockModuleExtension()
  2. 9 core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\PermissionHandlerTest::mockModuleExtension()

Provides an extension object for a given module with a human name.

Parameters

string $module: The module machine name.

string $name: The module human name.

Return value

\Drupal\Core\Extension\Extension The extension object.

File

core/modules/user/tests/src/Unit/PermissionHandlerTest.php, line 78
Contains \Drupal\Tests\user\Unit\PermissionHandlerTest.

Class

PermissionHandlerTest
Tests the permission handler.

Namespace

Drupal\Tests\user\Unit

Code

protected function mockModuleExtension($module, $name) {
  $extension = new Extension('vfs:/', $module, "modules/{$module}");
  $extension->info['name'] = $name;
  return $extension;
}