On the subject of what to test REST API?

Good afternoon , a REST API written in yii2 , was given the task to write for each method of the API test , the problem is that I can't understand what is considered reference data for comparison with the answer , so I made a test to call any API method and checking what response code is 200 and response type JSON , and reconciliation of all data types in the JSON object , it was said by the head of that little , and need to verify with data, but I think making static data via fixtures is not true , as they can be quite a lot (for example in a method that gets all products , which can be a lot) , pulling from a DB , too, it seems not the right approach , as in the model may be any business logic , and then it needs to translate in code test ?
June 10th 19 at 15:04
2 answers
June 10th 19 at 15:06
How to test the calculator?

  1. Write on a piece of 2+2=? 4.
  2. Click on the calculator data symbols, that is 4 - pass, 4 - failed.
  3. Write on a piece of paper 888*1234 = ? solved in a column or in any other way as I can. 1095792
  4. Click on the calculator these characters, turned 1095792 - test passed, failed 1095792 - fail.
  5. And so on.


Vkratse: need a place to personally record the required data and to compare them with.
June 10th 19 at 15:08
I think making static data via fixtures is not true , since there may be quite a lot (for example in a method that gets all products , which can be a lot) , pulling from a DB , too, it seems not the right approach

It has to be the fixtures www.yiiframework.com/doc-2.0/guide-test-fixtures.html
If a lot of goods - generate them in a loop. Make API request to my REST, and compare with the expected response.

Find more questions by tags Testing softwareAPI