If your API data level is abstracted enough so that you can get consistent and predictable results for a given input, your test cases should definitely include some general expected results for some final list of inputs. They should also check for any cases of errors you may drum.
If your API cannot work with a data layer that is in a predictable state (for example, if it is connected to current data or to data used by developers), you are going to spend a lot of time for your tests to correctly model the new data state. This makes unit testing less valuable, because you cannot run them as often, and since you never know if a crash occurred as a result of a data change or a change in the program logic. If this outweighs the risk of lack of unit tests or not, it will depend on your individual situation (how often the tests pass, how critical the service is, etc.).
As far as I can use PHPUnit to run test cases, I cannot answer this specifically, but I assume you will, as @basiljames noted; Make a call against this endpoint and make sure that the answer you receive matches your expectations correctly. This is no different from any other unit test, except that they may work a little slower.
cori
source share