You are here

public function SecureSiteFunctionUserLoadUnitTest::testSecureSiteUserLoadPass in Secure Site 7.2

Same name and namespace in other branches
  1. 6.2 securesite.test \SecureSiteFunctionUserLoadUnitTest::testSecureSiteUserLoadPass()

Load user with password.

File

./securesite.test, line 497
Tests for Secure Site module.

Class

SecureSiteFunctionUserLoadUnitTest
Unit tests for user_load().

Code

public function testSecureSiteUserLoadPass() {

  // D6: user_load(array('uid' => $this->user->uid, 'pass' => $this->user->pass_raw));
  // sime: D6 code doesn't return anything so I assume no array shifting or reset() is needed for D7 code.
  user_load_multiple(array(
    $this->user->uid,
  ), array(
    'pass' => $this->user->pass_raw,
  ));
  $command = "{$this->stored_passwords} {$this->name_arg} {$this->pass_arg} {$this->realm_arg}";
  $this
    ->assertTrue(exec($command) == 'Updated ' . $this->user->name . " in {$this->realm}.", t('Loading user with password.'));
}