Skip to content

Commit

Permalink
Modify order of variables to get more meaningull error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tbuczen committed Dec 21, 2021
1 parent 662dca6 commit cd9c47a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Behat/Context/GraphqlApiPlatformContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function thatResponseShouldContainKeyWithValue(string $key, $value): void
{
/** @psalm-suppress MixedAssignment */
$responseValueAtKey = $this->client->getValueAtKey($key);
Assert::same($value, $responseValueAtKey);
Assert::same($responseValueAtKey,$value);
}

/**
Expand Down Expand Up @@ -238,13 +238,15 @@ private function getJsonFromResponse(string $response): ?array

/**
* @Then I add :filterName filter to this operation with :value value
* @Then I add :filterName filter to this operation with :type value :value
*
* @param mixed $value
*/
public function iAddFilterToThisOperation(string $filterName, $value): void
public function iAddFilterToThisOperation(string $filterName, $value, string $type = null): void
{
$operation = $this->client->getLastOperationRequest();
Assert::isInstanceOf($operation, OperationRequestInterface::class);
$value = $this->castToType($value, $type);
$operation->addFilter($filterName, $value);
}
}

0 comments on commit cd9c47a

Please sign in to comment.