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
cf83a52a
Commit
cf83a52a
authored
Sep 16, 2014
by
alexpott
Browse files
Issue
#2339069
by rgoodine | joelpittet: Remove useless BlockPreprocessUnitTest.
parent
0391038b
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/modules/block/src/Tests/BlockPreprocessUnitTest.php
deleted
100644 → 0
View file @
0391038b
<?php
/**
* @file
* Contains \Drupal\block\Tests\BlockPreprocessUnitTest.
*/
namespace
Drupal\block\Tests
;
use
Drupal\simpletest\WebTestBase
;
/**
* Tests the template_preprocess_block() function.
*
* @group block
*/
class
BlockPreprocessUnitTest
extends
WebTestBase
{
/**
* Modules to enable.
*
* @var array
*/
public
static
$modules
=
array
(
'block'
);
/**
* Tests block classes with template_preprocess_block().
*/
function
testBlockClasses
()
{
// Define a block with a derivative to be preprocessed, which includes both
// an underscore (not transformed) and a hyphen (transformed to underscore),
// and generates possibilities for each level of derivative.
// @todo Clarify this comment.
/** @var \Drupal\block\BlockInterface $block */
$block
=
entity_create
(
'block'
,
array
(
'plugin'
=>
'system_menu_block:admin'
,
'region'
=>
'footer'
,
'id'
=>
\
Drupal
::
config
(
'system.theme'
)
->
get
(
'default'
)
.
'.machinename'
,
));
$variables
=
array
();
$variables
[
'elements'
][
'#block'
]
=
$block
;
$plugin
=
$block
->
getPlugin
();
$variables
[
'elements'
][
'#configuration'
]
=
$plugin
->
getConfiguration
();
$variables
[
'elements'
][
'#plugin_id'
]
=
$plugin
->
getPluginId
();
$variables
[
'elements'
][
'#base_plugin_id'
]
=
$plugin
->
getBaseId
();
$variables
[
'elements'
][
'#derivative_plugin_id'
]
=
$plugin
->
getDerivativeId
();
$variables
[
'elements'
][
'content'
]
=
array
();
// Test adding a class to the block content.
$variables
[
'content_attributes'
][
'class'
][]
=
'test-class'
;
template_preprocess_block
(
$variables
);
$this
->
assertEqual
(
$variables
[
'content_attributes'
][
'class'
],
array
(
'test-class'
),
'Test-class class added to block content_attributes'
);
}
}
Write
Preview
Supports
Markdown
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