function UrlResolverTest::providerUrlDiscovery

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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 101

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',
        ],
    ];
}

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