Skip to content

Commit

Permalink
Merge pull request #9 from MacPaw/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
borislt authored May 12, 2023
2 parents 6123ae3 + c469c1d commit 9c6faeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
run:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down
13 changes: 7 additions & 6 deletions src/Context/ApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ class ApiContext implements Context
/**
* @var array<string,string> $headers
*/
private array $headers = [];
protected array $headers = [];

/**
* @var array<string,string> $serverParams
*/
private array $serverParams = [];
protected array $serverParams = [];

/**
* @var array<mixed> $requestParams
*/
private array $requestParams = [];
protected array $requestParams = [];

/**
* @var array<mixed> $savedValues
*/
private array $savedValues = [];
protected array $savedValues = [];

public function __construct(
RouterInterface $router,
Expand Down Expand Up @@ -115,6 +115,7 @@ public function theRequestContainsParams(PyStringNode $params): void

$newRequestParams = (array) json_decode($processedParams, true, 512, JSON_THROW_ON_ERROR);
$this->requestParams = array_merge($this->requestParams, $newRequestParams);
$this->savedValues = array_merge($this->savedValues, $newRequestParams);
}

/**
Expand Down Expand Up @@ -277,7 +278,7 @@ public function responseShouldBeJsonWithVariableFields(string $variableFields, P
$this->compareStructureResponse($variableFields, $string, $this->getResponse()->getContent());
}

private function compareStructureResponse(string $variableFields, PyStringNode $string, string $actualJSON): void
protected function compareStructureResponse(string $variableFields, PyStringNode $string, string $actualJSON): void
{
if ($actualJSON === '') {
throw new RuntimeException('Response is not JSON');
Expand Down Expand Up @@ -305,7 +306,7 @@ private function resetRequestOptions(): void
$this->requestParams = [];
}

private function getResponse(): Response
protected function getResponse(): Response
{
if ($this->response === null) {
throw new RuntimeException('Response is null.');
Expand Down

0 comments on commit 9c6faeb

Please sign in to comment.