class OembedTestCase in oEmbed 8
Same name and namespace in other branches
- 7 oembed.test \OembedTestCase
- 7.0 oembed.test \OembedTestCase
Hierarchy
- class \OembedTestHelper extends \DrupalWebTestCase
- class \OembedTestCase
Expanded class hierarchy of OembedTestCase
File
- ./
oembed.test, line 106 - Tests for oembed.module.
View source
class OembedTestCase extends OembedTestHelper {
public static function getInfo() {
return array(
'name' => 'oEmbed requests',
'description' => 'Tests oEmbed request handling.',
'group' => 'oEmbed',
);
}
/**
* Tests that actual response type matches the expected response type.
*/
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);
}
}
}
/**
* Tests the oembed render element types.
*/
function testOembedRenderElements() {
foreach ($this->urls as $url => $info) {
$element = oembed_render_element('oembed', $url);
$this
->assertRenderedElement($element, '//*');
if (isset($info['thumbnail']) && $info['thumbnail']) {
$element = oembed_render_element('oembed_thumbnail', $url);
$this
->assertRenderedElement($element, '//img');
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OembedTestCase:: |
public static | function | ||
OembedTestCase:: |
function | Tests that actual response type matches the expected response type. | ||
OembedTestCase:: |
function | Tests the oembed render element types. | ||
OembedTestHelper:: |
protected | property | ||
OembedTestHelper:: |
protected | property | ||
OembedTestHelper:: |
function | Asserts file_entity_access correctly grants or denies access. | ||
OembedTestHelper:: |
protected | function | ||
OembedTestHelper:: |
function | 3 | ||
OembedTestHelper:: |
protected | function |