You are here

public function HoneypotAdminFormTestCase::testElementNameUpdateFirstCharacterFail in Honeypot 7

Test an invalid element name (invalid first character).

File

./honeypot.test, line 263
Testing for Honeypot module.

Class

HoneypotAdminFormTestCase
Test the functionality of the Honeypot module for an admin user.

Code

public function testElementNameUpdateFirstCharacterFail() {

  // Log in the admin user.
  $this
    ->drupalLogin($this->adminUser);

  // Set up form and submit it.
  $edit['honeypot_element_name'] = "1test";
  $this
    ->drupalPost('admin/config/content/honeypot', $edit, t('Save configuration'));

  // Form submission should fail.
  $this
    ->assertText(t('The element name must start with a letter.'), 'Honeypot element name assertion works for invalid names.');
}