public function FileFieldPathsRedirectTest::testUi in File (Field) Paths 8
Test File (Field) Paths Redirect UI.
File
- tests/
src/ Functional/ FileFieldPathsRedirectTest.php, line 45
Class
- FileFieldPathsRedirectTest
- Test redirect module integration.
Namespace
Drupal\Tests\filefield_paths\FunctionalCode
public function testUi() {
// Create a File field.
$field_name = mb_strtolower($this
->randomMachineName());
$this
->createFileField($field_name, 'node', $this->contentType);
// Ensure File (Field) Paths Pathauto settings are present and available.
$this
->drupalGet("admin/structure/types/manage/{$this->contentType}/fields/node.{$this->contentType}.{$field_name}");
// Redirect checkbox is present in File (Field) Path settings.
$this
->assertSession()
->fieldExists('third_party_settings[filefield_paths][redirect]');
$element = $this
->xpath('//input[@name=:name]/@disabled', [
':name' => 'third_party_settings[filefield_paths][redirect]',
]);
$this
->assertEmpty($element, 'Redirect checkbox is not disabled.');
}