You are here

public function RequiredByRoleEmailFieldWebTestCase::testRequiredByRole in Required by role 7

Test for both required and non-required roles.

File

tests/required_by_role_test/RequiredByRoleEmailFieldWebTestCase.test, line 48
Tests for the Email field.

Class

RequiredByRoleEmailFieldWebTestCase
@file Tests for the Email field.

Code

public function testRequiredByRole() {
  $edit = array();
  $edit['title'] = $this
    ->randomName(8);
  $edit['body[und][0][value]'] = $this
    ->randomName(16);
  $this
    ->drupalPost('node/add/' . $this->entity_bundle, $edit, t('Save'));
  $this
    ->assertText($this->field_label . ' field is required.');
  $this
    ->drupalLogout();
  $this
    ->drupalLogin($this
    ->getNonRequiredUser());
  $this
    ->drupalPost('node/add/' . $this->entity_bundle, $edit, t('Save'));
  $this
    ->assertText($edit['title'], "Node has been created");
}