Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scenario results comparison. #221

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hivelvet-backend/tests/src/Test/Scenario.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public function run($f3): array
*
* @throws \JsonException
*/
public function compareTemplateToResponse($path): bool
public function compareTemplateToResponse($path, $values): bool
{
$f3 = Base::instance();

return empty(array_diff($this->loadResult($path), json_decode($f3->get('RESPONSE'), true, 512, JSON_THROW_ON_ERROR)));
return empty(array_diff(json_decode($f3->get('RESPONSE'), true, 512, JSON_THROW_ON_ERROR), $this->loadResult($path)));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion hivelvet-backend/tests/templates/label/success.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"key": 20,
"name": "label",
"description": "description",
"color": "#ffffff"
"color": "{{ @data.color }}"
},
"status": 201
}