public function FileFieldPathsTransliterationCase::testUI in File (Field) Paths 7
Test File (Field) Paths Transliteration UI.
File
- tests/
transliteration.test, line 34 - Transliteration module tests for the File (Field) Paths module.
Class
- FileFieldPathsTransliterationCase
- Class FileFieldPathsTransliterationCase
Code
public function testUI() {
// Create a File field.
$field_name = drupal_strtolower($this
->randomName());
$this
->createFileField($field_name, $this->content_type);
// Ensure File (Field) Paths Transliteration settings are present and available.
$this
->drupalGet("admin/structure/types/manage/{$this->content_type}/fields/{$field_name}");
foreach (array(
'path',
'name',
) as $field) {
$this
->assertField("instance[settings][filefield_paths][file_{$field}][options][transliterate]", t('Transliteration checkbox is present in File @field settings.', array(
'@field' => drupal_ucfirst($field),
)));
$element = $this
->xpath('//input[@name=:name]/@disabled', array(
':name' => "instance[settings][filefield_paths][file_{$field}][options][transliterate]",
));
$this
->assert(empty($element), t('Transliteration checkbox is not disabled in File @field settings.', array(
'@field' => drupal_ucfirst($field),
)));
}
}