only in patch2: unchanged: --- /dev/null +++ b/core/modules/aggregator/tests/src/Unit/BubbleableMetadataTest.php @@ -0,0 +1,73 @@ +assertSame($expected, BubbleableMetadata::mergeAttachments($a, $b)); + } + + /** + * Data provider for testMergeAttachmentsFeedMerging. + * + * @return array + */ + 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], + ]; + } + +}