Beispiel #1
0
 public function testLoginSynchronizesInfoAndCallsAuthLogin()
 {
     $timezone = 'UTC';
     $this->fakeConfig->SetKey(ConfigKeys::DEFAULT_TIMEZONE, $timezone);
     $languageCode = 'en_US';
     $this->fakeConfig->SetKey(ConfigKeys::LANGUAGE, $languageCode);
     $expectedUser = new AuthenticatedUser($this->username, $this->ldapUser->GetEmail(), $this->ldapUser->GetFirstName(), $this->ldapUser->GetLastName(), $this->password, $languageCode, $timezone, $this->ldapUser->GetPhone(), $this->ldapUser->GetInstitution(), $this->ldapUser->GetTitle());
     $auth = new Ldap($this->fakeAuth, $this->fakeLdap, $this->fakeLdapOptions);
     $auth->SetRegistration($this->fakeRegistration);
     $auth->Validate($this->username, $this->password);
     $auth->Login($this->username, $this->loginContext);
     $this->assertTrue($this->fakeRegistration->_SynchronizeCalled);
     $this->assertEquals($expectedUser, $this->fakeRegistration->_LastSynchronizedUser);
     $this->assertEquals($this->loginContext, $this->fakeAuth->_LastLoginContext);
 }