test: refactor additional share role test scenarios
Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com> test: refactor additional share role test scenarios Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com>
This commit is contained in:
3 files changed
+779
-1670
No files matched your search
@@ -120,6 +120,37 @@ class OcisConfigContext implements Context {
|
||||
$this->setEnabledPermissionsRoles($defaultRoles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has enabled the following share permissions roles:
|
||||
*
|
||||
* @param TableNode $table
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorHasEnabledTheFollowingShareRoles(TableNode $table): void {
|
||||
$defaultRoles = array_values(GraphHelper::DEFAULT_PERMISSIONS_ROLES);
|
||||
$roles = [];
|
||||
foreach ($table->getHash() as $row) {
|
||||
$roles[] = $row['role'];
|
||||
$roleId = GraphHelper::getPermissionsRoleIdByName($row['role']);
|
||||
if (!\in_array($roleId, $defaultRoles)) {
|
||||
$defaultRoles[] = $roleId;
|
||||
}
|
||||
}
|
||||
|
||||
$envs = [
|
||||
"GRAPH_AVAILABLE_ROLES" => implode(',', $defaultRoles),
|
||||
];
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
"Failed to enable roles: " . implode(', ', $roles)
|
||||
);
|
||||
$this->setEnabledPermissionsRoles($defaultRoles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has disabled the permissions role :role
|
||||
*
|
||||
|
||||
+489
-864
File diff suppressed because it is too large.
Load diff
+259
-806
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user