O
O
olijen2015-08-27 18:57:04
JavaScript
olijen, 2015-08-27 18:57:04

How to write functional tests for REST full API?

I am creating an application based on this repository https://github.com/clevertech/YiiBackbone
Need functional tests for REST full API.
Jasmine is connected here, but I did not find the tests themselves. Can you tell me where to start, or where to get good examples of REST testing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-08-27
@matperez

REST testing is very easy: make a request, check the code and the body of the response. The request can be made at least through curl, if you feel like it, but it's better to take something more convenient. For example: ole.michelsen.dk/blog/testing-your-api-with-phpuni...
For codeception, there is also a good module for testing REST codeception.com/docs/modules/REST. I used it, it's handy. Codeception is also convenient in that out of the box it can work with the codeception.com/docs/modules/Db database and you can immediately check in the test whether the entity that you tried to change through the REST interface has changed in the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question