You are here

function OembedTestCase::testOembedProviderUrls in oEmbed 7.0

Same name and namespace in other branches
  1. 8 oembed.test \OembedTestCase::testOembedProviderUrls()
  2. 7 oembed.test \OembedTestCase::testOembedProviderUrls()

Tests that actual response type matches the expected response type.

File

./oembed.test, line 118
Tests for oembed.module.

Class

OembedTestCase

Code

function testOembedProviderUrls() {
  foreach ($this->urls as $url => $info) {
    foreach (array(
      'json',
      'xml',
    ) as $format) {
      $response = oembed_get_data($url, array(
        'format' => $format,
      ));
      $message = t('oEmbed @format response says @url is @type', array(
        '@url' => $url,
        '@type' => $info['type'],
        '@format' => $format,
      ));
      $this
        ->assertEqual($response['type'], $info['type'], $message);
    }
  }
}