You are here

protected function WorkbenchModerationTestCase::drupalGetToken in Workbench Moderation 7.3

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

Overrides DrupalWebTestCase::drupalGetToken

3 calls to WorkbenchModerationTestCase::drupalGetToken()
WorkbenchModerationModerateTabTestCase::testModerateTab in tests/workbench_moderation.test
WorkbenchModerationNodeAccessTestCase::testNodeAccessRecords in tests/workbench_moderation.node_access.test
Creates a node and tests the creation of node access rules.
WorkbenchModerationTransitionTestCase::testTransitionFromNodeForm in tests/workbench_moderation.transition.test

File

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

Class

WorkbenchModerationTestCase
@file Tests for workbench_moderation.module.

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());
}