function PermissionHandlerTest::mockModuleExtension

Same name in other branches
  1. 8.9.x core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\PermissionHandlerTest::mockModuleExtension()
  2. 10 core/modules/user/tests/src/Unit/PermissionHandlerTest.php \Drupal\Tests\user\Unit\PermissionHandlerTest::mockModuleExtension()
  3. 11.x 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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.