lchrusciel / ApiTestCase

Handy PHPUnit test case for testing JSON APIs in your Symfony applications.
MIT License
410 stars 35 forks source link

Symfony 4 support & 3.0 release #112

Closed pamil closed 6 years ago

pamil commented 6 years ago

It would be great to support Symfony 4, what is needed for this to happen?

emodric commented 6 years ago

Isn't it already supported? https://github.com/Lakion/ApiTestCase/releases/tag/v3.0.0-RC.1 :)

pamil commented 6 years ago

What I meant was a stable release with Symfony 4 support, as I can't require release candidates in Sylius. I've just changed the PR title to mention that.

emodric commented 6 years ago

Ah, okay :)

Yes, 3.0 stable release would be welcome for me too :)

lchrusciel commented 6 years ago

I will do it at the end of February / beginning of March

emodric commented 6 years ago

@lchrusciel Any news on 3.0 final release? :)

lchrusciel commented 6 years ago

The only thing that holds me back is Unicode support. It will destroy builds of many people. I was thinking about some regression support with a new option, so you can turn it on or off and remove it in ATC 4. It requires only one more condition here https://github.com/Lakion/ApiTestCase/blob/master/src/JsonApiTestCase.php#L90.

emodric commented 6 years ago

@lchrusciel Do you want something like this?

$jsonFlags = JSON_PRETTY_PRINT;
if (!isset($_SERVER['ESCAPE_JSON_UNICODE']) || true !== $_SERVER['ESCAPE_JSON_UNICODE']) {
    $jsonFlags = $jsonFlags | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;
}

return json_encode(json_decode($content), $jsonFlags);

This disables escaping by default, and only escapes the Unicode chars if ESCAPE_JSON_UNICODE env var is set to true.

lchrusciel commented 6 years ago

Something like this. I will increase adoption of a newest version

emodric commented 6 years ago

Want me to do a PR with this or you had some more things in mind?

lchrusciel commented 6 years ago

If you only can I will really appreciate it

emodric commented 6 years ago

@lchrusciel https://github.com/Lakion/ApiTestCase/pull/113 :)

lchrusciel commented 6 years ago

ATC 3.0 has been just published! 🎉