Closed symfonyaml closed 3 years ago
Thanks for the PR. Could you add a test or two that verifies this behaviour as well?
I can't seem to reproduce this error. I have added the following test:
Scenario: Reproduce bug from issue #93
Given a file named "features/bug-93.feature" with:
"""
Feature: Get data from endpoint
Scenario: Check the response
When I request "/bug-93"
Then the response body is a JSON array of length 1
"""
When I run "behat features/bug-93.feature"
Then it should fail with:
"""
The response body does not contain a valid JSON array. (InvalidArgumentException)
1 scenario (1 failed)
2 steps (1 passed, 1 failed)
"""
The /bug-93
endpoint returns the following JSON:
{
"1": {
"stringValue": "1\u00a0%"
},
"2": {
"stringValue": "2\u00a0%"
},
"3": {
"stringValue": "3\u00a0%"
}
}
Am I missing something?
Closing with because of lack of feedback. Feel free to re-open if you have some more information to add to the issue.
Problem
if the JSON response contains few percentage sign
%
, then theAssert\Assertion
class throw a PHP error because the sprintf if corrupted.For example in there
Reproduce
if the JSON response is exactly like this
with behat test assert
There is an error