You are here

protected function WorkbenchModerationModerateTabTestCase::drupalGetToken in Workbench Moderation 7

Override DrupalWebTestCase::drupalGetToken() as it does not return the correct token for the currently logged-in testing user.

Overrides DrupalWebTestCase::drupalGetToken

1 call to WorkbenchModerationModerateTabTestCase::drupalGetToken()
WorkbenchModerationModerateTabTestCase::testModerateTab in tests/workbench_moderation.test

File

tests/workbench_moderation.test, line 65
Tests for workbench_moderation.module.

Class

WorkbenchModerationModerateTabTestCase

Code

protected function drupalGetToken($value = '') {
  $session_id = $this->session_id;
  if (empty($session_id) && !empty($this->loggedInUser)) {
    $session_id = db_query("SELECT sid FROM {sessions} WHERE uid = :uid ORDER BY timestamp DESC", array(
      ':uid' => $this->loggedInUser->uid,
    ))
      ->fetchField();
  }
  return drupal_hmac_base64($value, $session_id . drupal_get_private_key() . drupal_get_hash_salt());
}