public function BubbleableMetadataTest::testAddAttachments in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php \Drupal\Tests\Core\Render\BubbleableMetadataTest::testAddAttachments()
@covers ::addAttachments @covers ::setAttachments @dataProvider providerTestAddAttachments
This only tests at a high level, because it reuses existing logic. Detailed tests exist for the existing logic:
See also
testMergeAttachmentsLibraryMerging()
testMergeAttachmentsFeedMerging()
testMergeAttachmentsHtmlHeadMerging()
testMergeAttachmentsHtmlHeadLinkMerging()
testMergeAttachmentsHttpHeaderMerging()
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ BubbleableMetadataTest.php, line 118 - Contains \Drupal\Tests\Core\Render\BubbleableMetadataTest.
Class
- BubbleableMetadataTest
- @coversDefaultClass \Drupal\Core\Render\BubbleableMetadata @group Render
Namespace
Drupal\Tests\Core\RenderCode
public function testAddAttachments(BubbleableMetadata $initial, $attachments, BubbleableMetadata $expected) {
$test = $initial;
$test
->addAttachments($attachments);
$this
->assertEquals($expected, $test);
}