You are here

public function UrlResolverTest::providerUrlDiscovery in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::providerUrlDiscovery()
  2. 10 core/modules/media/tests/src/Functional/UrlResolverTest.php \Drupal\Tests\media\Functional\UrlResolverTest::providerUrlDiscovery()

Data provider for testUrlDiscovery().

Return value

array

See also

::testUrlDiscovery()

File

core/modules/media/tests/src/Functional/UrlResolverTest.php, line 102

Class

UrlResolverTest
Tests the oEmbed URL resolver service.

Namespace

Drupal\Tests\media\Functional

Code

public function providerUrlDiscovery() {
  return [
    'JSON resource' => [
      'video_vimeo.html',
      'https://vimeo.com/api/oembed.json?url=video_vimeo.html',
    ],
    'XML resource' => [
      'video_collegehumor.html',
      // The endpoint does not explicitly declare that it supports XML, so
      // only JSON support is assumed, which is why the discovered URL
      // contains '.json'. However, the fetched HTML file contains a
      // relationship to an XML representation of the resource, with the
      // application/xml+oembed MIME type.
      'http://www.collegehumor.com/oembed.json?url=video_collegehumor.html',
    ],
  ];
}