-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathGetSiteAccessesListTest.php
More file actions
57 lines (50 loc) · 1.72 KB
/
Copy pathGetSiteAccessesListTest.php
File metadata and controls
57 lines (50 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);
namespace Ibexa\Tests\Integration\AdminUi\REST;
use Ibexa\Contracts\Test\Rest\Request\Value\EndpointRequestDefinition;
/**
* Coverage for /site-access/by-location/{locationId} REST endpoint.
*/
final class GetSiteAccessesListTest extends BaseAdminUiRestWebTestCase
{
/**
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ForbiddenException
*/
protected function setUp(): void
{
parent::setUp();
// to create a new user before logging-in via REST
$this->getIbexaTestCore()->setAdministratorUser();
$this->loginAsUser(
$this->createUserWithPolicies(
'editor',
[
'user/login' => [],
'content/read' => [],
'content/versionread' => [],
]
)
);
}
protected static function getEndpointsToTest(): iterable
{
foreach (self::REQUIRED_FORMATS as $format) {
yield new EndpointRequestDefinition(
'GET',
'/api/ibexa/v2/site-access/by-location/2?resolver_type=non_admin',
'SiteAccessesList',
"application/vnd.ibexa.api.SiteAccessesList+$format",
['HTTP_X-SiteAccess' => 'admin'],
null,
null,
'SiteAccessesList'
);
}
}
}