Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
How I can unit-test APIs? Is there any method for asserting API response in drupal 7?
You can find an example in the Examples for Developers module. Here are two excellent guides:
Required, but never shown