private function Registered() { $mySession = ServiceLocator::GetServer()->GetUserSession(); $userrepo = new UserRepository(); $user = $userrepo->LoadByPublicId($mySession->PublicId); $credi = $user->GetAttributeValue(19); return $credi; }
public function testLoadsUserByPublicId() { $userRow = $this->GetUserRow(); $emailPrefRows = $this->GetEmailPrefRows(); $permissionsRows = $this->GetPermissionsRows(); $groupsRows = $this->GetGroupsRows(); $attributeRows = $this->GetAttributeRows(); $ownedGroupRows = $this->GetOwnedGroupRows(); $preferenceRows = $this->GetPreferenceRows(); $this->db->SetRow(0, array($userRow)); $this->db->SetRow(1, $emailPrefRows); $this->db->SetRow(2, $permissionsRows); $this->db->SetRow(3, $groupsRows); $this->db->SetRow(4, $attributeRows); $this->db->SetRow(5, $ownedGroupRows); $this->db->SetRow(6, $preferenceRows); $publicId = uniqid(); $userRepository = new UserRepository(); $user = $userRepository->LoadByPublicId($publicId); $loadByIdCommand = new GetUserByPublicIdCommand($publicId); $this->assertEquals(7, count($this->db->_Commands)); $this->assertTrue($this->db->ContainsCommand($loadByIdCommand)); $this->assertNotNull($user); }