Ejemplo n.º 1
0
 /**
  * @test
  * @group userservice
  */
 public function should_get_user_with_acls()
 {
     $userId = 1;
     $orgId = 2;
     $this->orgRepo->shouldReceive('organizationOfId')->andReturn($this->klimtoren);
     $this->userRepo->shouldReceive('userOfId')->andReturn($this->karl);
     $this->userRepo->shouldReceive('userWithACL')->andReturn($this->karl);
     /** @var User $r_user */
     $r_user = $this->userService->getUserWithACL($userId, $orgId);
     $this->assertInstanceOf('Bakgat\\Notos\\Domain\\Model\\Identity\\User', $r_user);
     //TODO how is UserRole added to a user?
     //so we can test that here
     // $this->assertCount(2, $r_user->getRoles());
 }
Ejemplo n.º 2
0
 /**
  * Returns full profile of an user to update
  *
  * @param $orgId
  * @param $userId
  * @return mixed
  */
 public function edit($orgId, $userId)
 {
     $result = $this->userService->getUserWithACL($userId, $orgId);
     return $this->jsonResponse($result);
 }