function MediaElementSettingsTestCase::testInsecureSettings in D7 Media 7.3
Same name and namespace in other branches
- 7.4 tests/media.test \MediaElementSettingsTestCase::testInsecureSettings()
- 7.2 tests/media.test \MediaElementSettingsTestCase::testInsecureSettings()
Tests that the field widget does not contain the insecure settings.
File
- tests/
media.test, line 907 - Tests for media.module.
Class
- MediaElementSettingsTestCase
- Tests the 'media' element type settings.
Code
function testInsecureSettings() {
// Use 'page' instead of 'article', so that the 'article' image field does
// not conflict with this test. If in the future the 'page' type gets its
// own default file or image field, this test can be made more robust by
// using a custom node type.
$type_name = 'page';
$field_name = strtolower($this
->randomName());
$this
->createFileField($field_name, $type_name);
$this
->drupalGet("node/add/{$type_name}");
$insecure_settings = array(
'file_directory',
'file_extensions',
'max_filesize',
'uri_scheme',
);
foreach ($insecure_settings as $setting) {
$this
->assertNoRaw($setting, format_string('Media file field widget does not contain the insecure element-specific setting @setting.', array(
'@setting' => $setting,
)));
}
}