Commit 838250e3 authored by Mariano D'Agostino's avatar Mariano D'Agostino
Browse files

Issue #2250079: Add automated tests.

parent d6a6f575
Loading
Loading
Loading
Loading
+14 −0
Changes for tests/scriptfield.test: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -114,6 +114,20 @@ class ScriptFieldFieldTestCase extends DrupalWebTestCase {
      $this->drupalPost(NULL, $edit, t('Save'));
      $this->assertText(t('You can not include .. in the URL.'));
    }

    $non_allowed_chars = array(
      'good.js"><script href="bad.js',
      '"bad".js',
    );

    foreach ($non_allowed_chars as $wrong_entry) {
      $this->drupalGet('test-entity/add/test-bundle');
      $edit = array(
        "{$this->field['field_name']}[$langcode][0][value]" => $wrong_entry,
      );
      $this->drupalPost(NULL, $edit, t('Save'));
      $this->assertText(t('The specified file name is not valid, please use only alphanumeric characters, "/", "-", "_" or "."'));
    }
  }

  /**