fix after review

This commit is contained in:
Viktor Scharf
2024-09-12 10:08:43 +02:00
parent 283948487b
commit 438e445a1c
5 changed files with 50 additions and 16 deletions
@@ -162,6 +162,7 @@ class FeatureContext extends BehatVariablesContext {
public TUSContext $tusContext;
public GraphContext $graphContext;
public SpacesContext $spacesContext;
public OcmContext $ocmContext;
/**
* The codes are stored as strings, even though they are numbers
@@ -2318,10 +2319,10 @@ class FeatureContext extends BehatVariablesContext {
"parameter" => []
],
[
"code" => "%fed_invitation_token_pattern%",
"code" => "%fed_invitation_token%",
"function" => [
__NAMESPACE__ . '\TestHelpers\GraphHelper',
"getUUIDv4Regex"
$this->ocmContext,
"getLastFederatedInvitationToken"
],
"parameter" => []
],
@@ -2530,12 +2531,14 @@ class FeatureContext extends BehatVariablesContext {
$this->ocsContext = new OCSContext();
$this->authContext = new AuthContext();
$this->tusContext = new TUSContext();
$this->ocmContext = new OcmContext();
$this->ocsContext->before($scope);
$this->authContext->setUpScenario($scope);
$this->tusContext->setUpScenario($scope);
$environment->registerContext($this->ocsContext);
$environment->registerContext($this->authContext);
$environment->registerContext($this->tusContext);
$environment->registerContext($this->ocmContext);
$scenarioLine = $scope->getScenario()->getLine();
$featureFile = $scope->getFeature()->getFile();
$suiteName = $scope->getSuite()->getName();
+8 -1
View File
@@ -68,6 +68,13 @@ class OcmContext implements Context {
return $this->extractDomain(\getenv('TEST_SERVER_FED_URL'));
}
/**
* @return string
*/
public function getLastFederatedInvitationToken():string {
return $this->invitationToken;
}
/**
* @param string $url
*
@@ -151,7 +158,7 @@ class OcmContext implements Context {
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
$token ? $token : $this->invitationToken,
$token ? $token : $this->getLastFederatedInvitationToken(),
$providerDomain
);
}