public function setup()
 {
     parent::setup();
     $this->page = new FakeRegistrationPage();
     $this->fakeAuth = new FakeWebAuthentication();
     $this->activation = new FakeActivation();
     $this->user = new FakeUser();
     $this->user->ChangeEmailAddress('*****@*****.**');
     $this->context = new WebLoginContext(new LoginData(false, 'en_us'));
     $this->postRegistration = new PostRegistration($this->fakeAuth, $this->activation);
 }
示例#2
0
 function setup()
 {
     parent::setup();
     $this->username = '******';
     $this->password = '******';
     $this->id = 191;
     $this->fname = 'Test';
     $this->lname = 'Name';
     $this->email = '*****@*****.**';
     $this->isAdmin = true;
     $this->timezone = "US/Central";
     $this->lastLogin = time();
     $this->homepageId = 2;
     $this->languageCode = 'en_us';
     $this->publicId = 'public_id';
     $this->scheduleId = 111;
     $this->groups = array(new UserGroup(999, '1'), new UserGroup(888, '2'));
     $this->user = new FakeUser();
     $this->user->WithId($this->id);
     $this->user->ChangeName($this->fname, $this->lname);
     $this->user->ChangeEmailAddress($this->email);
     $this->user->ChangeTimezone($this->timezone);
     $this->user->ChangeDefaultHomePage($this->homepageId);
     $this->user->SetLanguage($this->languageCode);
     $this->user->WithPublicId($this->publicId);
     $this->user->Activate();
     $this->user->WithDefaultSchedule($this->scheduleId);
     $this->user->WithGroups($this->groups);
     $this->fakePassword = new FakePassword();
     $this->fakeMigration = new FakeMigration();
     $this->fakeMigration->_Password = $this->fakePassword;
     $this->authorization = $this->getMock('IRoleService');
     $this->userRepository = $this->getMock('IUserRepository');
     $this->auth = new Authentication($this->authorization, $this->userRepository);
     $this->auth->SetMigration($this->fakeMigration);
     $this->loginContext = new WebLoginContext(new LoginData());
 }