Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542
This commit is contained in:
parent
3b2511d96d
commit
81ccda77eb
2155 changed files with 54307 additions and 46870 deletions
|
@ -168,35 +168,41 @@ class PermissionHandlerTest extends UnitTestCase {
|
|||
->method('getModuleDirectories')
|
||||
->willReturn([
|
||||
'module_a' => vfsStream::url('modules/module_a'),
|
||||
'module_b' => vfsStream::url('modules/module_b'),
|
||||
'module_c' => vfsStream::url('modules/module_c'),
|
||||
]);
|
||||
$this->moduleHandler->expects($this->exactly(3))
|
||||
->method('getName')
|
||||
->will($this->returnValueMap([
|
||||
['module_a', 'Module a'],
|
||||
['module_b', 'Module b'],
|
||||
['module_c', 'A Module'],
|
||||
]));
|
||||
|
||||
$url = vfsStream::url('modules');
|
||||
mkdir($url . '/module_a');
|
||||
file_put_contents($url . '/module_a/module_a.permissions.yml',
|
||||
"access_module_a2: single_description
|
||||
access_module_a1: single_description"
|
||||
"access_module_a2: single_description2
|
||||
access_module_a1: single_description1"
|
||||
);
|
||||
mkdir($url . '/module_b');
|
||||
file_put_contents($url . '/module_b/module_b.permissions.yml',
|
||||
"access_module_a3: single_description"
|
||||
);
|
||||
mkdir($url . '/module_c');
|
||||
file_put_contents($url . '/module_c/module_c.permissions.yml',
|
||||
"access_module_a4: single_description"
|
||||
);
|
||||
$modules = ['module_a'];
|
||||
$extensions = [
|
||||
'module_a' => $this->mockModuleExtension('module_a', 'Module a'),
|
||||
];
|
||||
$this->moduleHandler->expects($this->any())
|
||||
->method('getImplementations')
|
||||
->with('permission')
|
||||
->willReturn([]);
|
||||
|
||||
$this->moduleHandler->expects($this->any())
|
||||
$modules = ['module_a', 'module_b', 'module_c'];
|
||||
$this->moduleHandler->expects($this->once())
|
||||
->method('getModuleList')
|
||||
->willReturn(array_flip($modules));
|
||||
|
||||
$this->permissionHandler = new TestPermissionHandler($this->moduleHandler, $this->stringTranslation, $this->controllerResolver);
|
||||
|
||||
// Setup system_rebuild_module_data().
|
||||
$this->permissionHandler->setSystemRebuildModuleData($extensions);
|
||||
|
||||
$actual_permissions = $this->permissionHandler->getPermissions();
|
||||
|
||||
$this->assertEquals(['access_module_a1', 'access_module_a2'], array_keys($actual_permissions));
|
||||
$permissionHandler = new TestPermissionHandler($this->moduleHandler, $this->stringTranslation, $this->controllerResolver);
|
||||
$actual_permissions = $permissionHandler->getPermissions();
|
||||
$this->assertEquals(['access_module_a4', 'access_module_a1', 'access_module_a2', 'access_module_a3'],
|
||||
array_keys($actual_permissions));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,14 +8,8 @@
|
|||
*
|
||||
* Available variables:
|
||||
* - content: A list of content items. Use 'content' to print all content, or
|
||||
* print a subset such as 'content.field_example'.
|
||||
* - Field variables: For each field attached to the user a corresponding
|
||||
* variable is defined; e.g., account.field_example has a variable
|
||||
* 'field_example' defined. When needing to access a field's raw values,
|
||||
* developers/themers are strongly encouraged to use these variables.
|
||||
* Otherwise they will have to explicitly specify the desired field language,
|
||||
* e.g. account.field_example.en, thus overriding any language negotiation
|
||||
* rule that was previously applied.
|
||||
* print a subset such as 'content.field_example'. Fields attached to a user
|
||||
* such as 'user_picture' are available as 'content.user_picture'.
|
||||
* - attributes: HTML attributes for the container element.
|
||||
* - user: A Drupal User entity.
|
||||
*
|
||||
|
|
Reference in a new issue