public function testSyncsGroups() { $this->fakeLdapOptions->_SyncGroups = true; $auth = new ActiveDirectory($this->fakeAuth, $this->fakeLdap, $this->fakeLdapOptions); $auth->SetRegistration($this->fakeRegistration); $auth->SetGroupRepository($this->fakeGroupRepository); $this->fakeGroupRepository->_AddGroup(new GroupItemView(1, 'Group1')); $this->fakeGroupRepository->_AddGroup(new GroupItemView(3, 'Group3')); $this->fakeGroupRepository->_AddGroup(new GroupItemView(4, 'Group4')); $auth->Validate($this->username, $this->password); $auth->Login($this->username, $this->loginContext); $this->assertEquals(array(new UserGroup(1, 'Group1'), new UserGroup(3, 'Group3')), $this->fakeRegistration->_LastSynchronizedUser->GetGroups()); }