function BubbleableMetadataTest::providerTestMergeAttachmentsFeedMerging

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php \Drupal\Tests\Core\Render\BubbleableMetadataTest::providerTestMergeAttachmentsFeedMerging()

Data provider for testMergeAttachmentsFeedMerging.

Return value

array

File

core/modules/aggregator/tests/src/Unit/BubbleableMetadataTest.php, line 31

Class

BubbleableMetadataTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Render%21BubbleableMetadata.php/class/BubbleableMetadata/9" title="Value object used for bubbleable rendering metadata." class="local">\Drupal\Core\Render\BubbleableMetadata</a> @group aggregator @group legacy

Namespace

Drupal\Tests\aggregator\Unit

Code

public function providerTestMergeAttachmentsFeedMerging() {
    $feed_a = [
        'aggregator/rss',
        'Feed title',
    ];
    $feed_b = [
        'taxonomy/term/1/feed',
        'RSS - foo',
    ];
    $a = [
        'feed' => [
            $feed_a,
        ],
    ];
    $b = [
        'feed' => [
            $feed_b,
        ],
    ];
    $expected_a = [
        'feed' => [
            $feed_a,
            $feed_b,
        ],
    ];
    // Merging in the opposite direction yields the opposite library order.
    $expected_b = [
        'feed' => [
            $feed_b,
            $feed_a,
        ],
    ];
    return [
        [
            $a,
            $b,
            $expected_a,
        ],
        [
            $b,
            $a,
            $expected_b,
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.