function LinkTest::linkMergeProvider
Provides test data for link merging.
File
- 
              core/modules/ jsonapi/ tests/ src/ Unit/ JsonApiResource/ LinkTest.php, line 105 
Class
- LinkTest
- @coversDefaultClass \Drupal\jsonapi\JsonApiResource\Link[[api-linebreak]] @group jsonapi
Namespace
Drupal\Tests\jsonapi\Unit\JsonApiResourceCode
public function linkMergeProvider() {
  $this->mockUrlAssembler();
  return [
    'same everything' => [
      new Link((new CacheableMetadata())->addCacheTags([
        'foo',
      ]), Url::fromUri('https://jsonapi.org/foo'), 'self'),
      new Link((new CacheableMetadata())->addCacheTags([
        'foo',
      ]), Url::fromUri('https://jsonapi.org/foo'), 'self'),
      new Link((new CacheableMetadata())->addCacheTags([
        'foo',
      ]), Url::fromUri('https://jsonapi.org/foo'), 'self'),
    ],
    'different cache tags' => [
      new Link((new CacheableMetadata())->addCacheTags([
        'foo',
      ]), Url::fromUri('https://jsonapi.org/foo'), 'self'),
      new Link((new CacheableMetadata())->addCacheTags([
        'bar',
      ]), Url::fromUri('https://jsonapi.org/foo'), 'self'),
      new Link((new CacheableMetadata())->addCacheTags([
        'foo',
        'bar',
      ]), Url::fromUri('https://jsonapi.org/foo'), 'self'),
    ],
  ];
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
