Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
11ffad24
Commit
11ffad24
authored
Aug 09, 2016
by
alexpott
Browse files
Issue
#2780703
by chx: Improve context variable names in Block UI test
parent
ffe7d13a
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/block/src/Tests/BlockUiTest.php
View file @
11ffad24
...
...
@@ -230,7 +230,7 @@ public function testContextAwareBlocks() {
$this
->
assertTrue
(
!
empty
(
$definition
),
'The context-aware test block exists.'
);
$edit
=
[
'region'
=>
'content'
,
'settings[context_mapping][user]'
=>
'@block_test.multiple_static_context:user
2
'
,
'settings[context_mapping][user]'
=>
'@block_test.multiple_static_context:user
B
'
,
];
$this
->
drupalPostForm
(
$block_url
,
$edit
,
'Save block'
);
...
...
core/modules/block/tests/modules/block_test/src/ContextProvider/MultipleStaticContext.php
View file @
11ffad24
...
...
@@ -47,9 +47,9 @@ public function __construct(AccountInterface $account, EntityManagerInterface $e
public
function
getRuntimeContexts
(
array
$unqualified_context_ids
)
{
$current_user
=
$this
->
userStorage
->
load
(
$this
->
account
->
id
());
$context1
=
new
Context
(
new
ContextDefinition
(
'entity:user'
,
'User
1
'
),
$current_user
);
$context1
=
new
Context
(
new
ContextDefinition
(
'entity:user'
,
'User
A
'
),
$current_user
);
$context2
=
new
Context
(
new
ContextDefinition
(
'entity:user'
,
'User
2
'
),
$current_user
);
$context2
=
new
Context
(
new
ContextDefinition
(
'entity:user'
,
'User
B
'
),
$current_user
);
$cacheability
=
new
CacheableMetadata
();
$cacheability
->
setCacheContexts
([
'user'
]);
...
...
@@ -58,8 +58,8 @@ public function getRuntimeContexts(array $unqualified_context_ids) {
$context2
->
addCacheableDependency
(
$cacheability
);
return
[
'user
1
'
=>
$context1
,
'user
2
'
=>
$context2
,
'user
A
'
=>
$context1
,
'user
B
'
=>
$context2
,
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment