function BubbleableMetadataTest::testAddAttachments
Tests addAttachments().
This only tests at a high level, because it reuses existing logic. Detailed tests exist for the existing logic:
@legacy-covers ::addAttachments @legacy-covers ::setAttachments
Attributes
#[DataProvider('providerTestAddAttachments')]
See also
testMergeAttachmentsLibraryMerging()
testMergeAttachmentsFeedMerging()
testMergeAttachmentsHtmlHeadMerging()
testMergeAttachmentsHtmlHeadLinkMerging()
testMergeAttachmentsHttpHeaderMerging()
File
-
core/
tests/ Drupal/ Tests/ Core/ Render/ BubbleableMetadataTest.php, line 120
Class
Namespace
Drupal\Tests\Core\RenderCode
public function testAddAttachments(BubbleableMetadata $initial, $attachments, BubbleableMetadata $expected) : void {
$test = $initial;
$test->addAttachments($attachments);
$this->assertEquals($expected, $test);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.