Home » Php » php – How to test sorting of a json-api in a leagacy system

php – How to test sorting of a json-api in a leagacy system

Posted by: admin February 25, 2020 Leave a comment

Questions:

I’m creating a REST-API with the json-API specification for a leagacy project with lumen. How to unit test the sorting accodingly? The database could not be seeded without a huge rewrite. So I tried to fetch the data and sort it via array_multisort to produce the expected result. The response form the API is sorted via ORDER BY form the database.

How to check the sorting mechanism? The HTTP status codes are already checke correct.

How to&Answers: