1 theme.test | RenderElementTypesTestCase::testHeadTag() |
Tests system #type 'head_tag'.
File
- core/
modules/ simpletest/ tests/ theme.test, line 694 - Tests for the theme API.
Class
- RenderElementTypesTestCase
- Tests the markup of core render element types passed to backdrop_render().
Code
function testHeadTag() {
$elements = array(
// Test auto-closure meta tag generation.
array(
'name' => "#type 'head_tag' auto-closure meta tag generation",
'value' => array(
'#type' => 'head_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'description',
'content' => 'Backdrop test',
),
),
'expected' => '<meta name="description" content="Backdrop test" />' . "\n",
),
// Test title tag generation.
array(
'name' => "#type 'head_tag' title tag generation",
'value' => array(
'#type' => 'head_tag',
'#tag' => 'title',
'#value' => 'title test',
),
'expected' => '<title>title test</title>' . "\n",
),
);
$this->assertElements($elements);
}