You are here

function ContactAttachContactFormsTestCase::drupalLoginWithUserGlobalRolesUpdate in Contact Attach 7

Logs in a user with the internal browser and updates the $user global.

drupalLogin() does not update the $user global after logging in. This function populates $user->roles with the roles defined in the user object.

Parameters

stdClass $user_object: User object representing the user to log in.

4 calls to ContactAttachContactFormsTestCase::drupalLoginWithUserGlobalRolesUpdate()
ContactAttachContactFormsTestCase::checkExistenceOfAttachmentFields in ./contact_attach.test
Checks existence of attachment fields on site-wide and user contact forms.
ContactAttachContactFormsTestCase::checkNumberOfAttachmentFields in ./contact_attach.test
Checks the number of attachment fields after setting the variable.
ContactAttachContactFormsTestCase::submitAttachmentWhenNoSettingsSet in ./contact_attach.test
Submits contact forms with attachments when no settings are set.
ContactAttachContactFormsTestCase::submitWithAttachments in ./contact_attach.test
Submits contact forms with attachments after setting the settings.

File

./contact_attach.test, line 615
Tests for the Contact Attach module.

Class

ContactAttachContactFormsTestCase
Tests the Contact Attach functionality for site-wide and user contact forms.

Code

function drupalLoginWithUserGlobalRolesUpdate(stdClass $user_object) {
  global $user;
  $this
    ->drupalLogin($user_object);
  $user->roles = $user_object->roles;
}