public function FileFieldPathsRedirectTestCase::testUI in File (Field) Paths 7
Test File (Field) Paths Redirect UI.
File
- tests/
redirect.test, line 34 - Redirect module tests for the File (Field) Paths module.
Class
- FileFieldPathsRedirectTestCase
- Class FileFieldPathsRedirectTestCase
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 Pathauto settings are present and available.
$this
->drupalGet("admin/structure/types/manage/{$this->content_type}/fields/{$field_name}");
$this
->assertField('instance[settings][filefield_paths][redirect]', t('Redirect checkbox is present in File (Field) Path settings.'));
$element = $this
->xpath('//input[@name=:name]/@disabled', array(
':name' => 'instance[settings][filefield_paths][redirect]',
));
$this
->assert(empty($element), t('Redirect checkbox is not disabled.'));
}