Skip to content

Commit

Permalink
feat: expand list of licence and application statuses included in mes…
Browse files Browse the repository at this point in the history
…saging dropdown (#285)
  • Loading branch information
fibble authored Aug 29, 2024
1 parent 7f08942 commit cfa8a36
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,22 @@ public function handleQuery(QueryInterface $query): array

$licences = $licenceRepository->fetchByOrganisationIdAndStatuses(
$orgId,
[Licence::LICENCE_STATUS_VALID, Licence::LICENCE_STATUS_SUSPENDED, Licence::LICENCE_STATUS_CURTAILED],
[
Licence::LICENCE_STATUS_VALID,
Licence::LICENCE_STATUS_SUSPENDED,
Licence::LICENCE_STATUS_CURTAILED,
Licence::LICENCE_STATUS_SURRENDER_UNDER_CONSIDERATION
],
);

/** @var Application[] $applications */
$applications = $applicationRepository->fetchByOrganisationIdAndStatuses(
$orgId,
[Entity::APPLICATION_STATUS_UNDER_CONSIDERATION, Entity::APPLICATION_STATUS_UNDER_CONSIDERATION],
[
Entity::APPLICATION_STATUS_UNDER_CONSIDERATION,
Entity::APPLICATION_STATUS_UNDER_CONSIDERATION,
Entity::APPLICATION_STATUS_GRANTED
],
);

$results = array_fill_keys(['licences', 'applications'], []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@ public function setUp(): void
$this->mockRepo(Repository\Application::class, Repository\Application::class);
$this->mockRepo(Repository\Licence::class, Repository\Licence::class);

$this->mockedSmServices = ['SectionAccessService' => m::mock(), AuthorizationService::class => m::mock(AuthorizationService::class)->shouldReceive('isGranted')->with(Permission::SELFSERVE_USER, null)->andReturn(true)->shouldReceive('isGranted')->with(Permission::INTERNAL_USER, null)->andReturn(false)->getMock(),];

$this->mockedSmServices[AuthorizationService::class]->shouldReceive('getIdentity->getUser->getId')->andReturn(1);
$this->mockedSmServices = [
'SectionAccessService' => m::mock(),
AuthorizationService::class => m::mock(AuthorizationService::class)
->shouldReceive('isGranted')
->with(Permission::SELFSERVE_USER, null)
->andReturn(true)
->shouldReceive('isGranted')
->with(Permission::INTERNAL_USER, null)
->andReturn(false)
->getMock(),
];

$this->mockedSmServices[AuthorizationService::class]
->shouldReceive('getIdentity->getUser->getId')
->andReturn(1);

parent::setUp();
}
Expand Down

0 comments on commit cfa8a36

Please sign in to comment.