Testing with restful api in TYPO3 FLOW

Hi everyone,

Currently I am responsible to write a test for one FLOW project. I have integrated UAT, UNIT, and Functional test. But I have no idea which type of test should be apply for restful api as well as how to write it.

Could someone give some tips or guide how to write test with FLOW restful api?


Hi Nguonchhay

I think there’s no right or wrong choice of tools here. Recently we decided to use PhpUnit for a smaller project to test the API Endpoints, you can find an explanation here: https://ole.michelsen.dk/blog/testing-your-api-with-phpunit.html

The alternative that we’ve looked at was Behat (example https://github.com/deminy/behat-rest-testing). But since this smallish project was not using any Behat/Behavior tests at all, we’ve decided to use PhpUnit for now (with the option to migrate them to proper Behat tests later on)

Best wishes,

Internally we use Behat for functional testing of our API, it’s pretty nice even more if you use TDD, you write your API spec, the behat code required to run them, and finally implement the API. If something need to change in the API, update the spec, and code … TDD with behat is really nice.

1 Like