public function BubbleableMetadataTest::providerTestMergeAttachmentsHtmlHeadLinkMerging in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php \Drupal\Tests\Core\Render\BubbleableMetadataTest::providerTestMergeAttachmentsHtmlHeadLinkMerging()
Data provider for testMergeAttachmentsHtmlHeadLinkMerging
Return value
array
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ BubbleableMetadataTest.php, line 534
Class
- BubbleableMetadataTest
- @coversDefaultClass \Drupal\Core\Render\BubbleableMetadata @group Render
Namespace
Drupal\Tests\Core\RenderCode
public function providerTestMergeAttachmentsHtmlHeadLinkMerging() {
$rel = [
'rel' => 'rel',
'href' => 'http://rel.example.com',
];
$shortlink = [
'rel' => 'shortlink',
'href' => 'http://shortlink.example.com',
];
$a = [
'html_head_link' => [
$rel,
TRUE,
],
];
$b = [
'html_head_link' => [
$shortlink,
FALSE,
],
];
$expected_a = [
'html_head_link' => [
$rel,
TRUE,
$shortlink,
FALSE,
],
];
// Merging in the opposite direction yields the opposite library order.
$expected_b = [
'html_head_link' => [
$shortlink,
FALSE,
$rel,
TRUE,
],
];
return [
[
$a,
$b,
$expected_a,
],
[
$b,
$a,
$expected_b,
],
];
}