add tests for new role space editor withour versions
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@ use Behat\Behat\Context\Context;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use TestHelpers\OcisConfigHelper;
|
||||
use TestHelpers\GraphHelper;
|
||||
use PHPUnit\Framework\Assert;
|
||||
|
||||
/**
|
||||
@@ -75,6 +76,31 @@ class OcisConfigContext implements Context {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has enabled the permissions role :role
|
||||
*
|
||||
* @param string $role
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorHasEnabledTheRole(string $role): void {
|
||||
$roleId = GraphHelper::getPermissionsRoleIdByName($role);
|
||||
$defaultRoles = array_values(GraphHelper::DEFAULT_PERMISSIONS_ROLES);
|
||||
|
||||
if (!\in_array($role, $defaultRoles)) {
|
||||
$defaultRoles[] = $roleId;
|
||||
}
|
||||
$envs = [
|
||||
"GRAPH_AVAILABLE_ROLES" => implode(',', $defaultRoles),
|
||||
];
|
||||
$response = OcisConfigHelper::reConfigureOcis($envs);
|
||||
Assert::assertEquals(
|
||||
200,
|
||||
$response->getStatusCode(),
|
||||
"Failed to enable role $role"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the config :configVariable has been set to path :path
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user