Skip to content

Commit

Permalink
Merge pull request #61 from OpenClassrooms/handle-20x-statuses-exampl…
Browse files Browse the repository at this point in the history
…es-prep
  • Loading branch information
sidux authored Apr 4, 2024
2 parents 1831d5f + cc21437 commit be171f6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Preparator/ExamplesPreparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@ private function prepareTestCases(Operation $operation): iterable

return $examples
->map(
fn (OperationExample $example) => $this->buildTestCase(
$example->setAutoComplete($this->config->autoComplete)
)
function (OperationExample $example) {
if ($this->config->response->statusCode !== null) {
$example->setStatusCode($this->config->response->statusCode);
}
$example->setAutoComplete($this->config->autoComplete);

return $this->buildTestCase($example);
}
)
;
}
Expand Down

0 comments on commit be171f6

Please sign in to comment.