Drupal7

http://patshaughnessy.net/2008/12/12/writing-your-first-phpunit-test-in-drupal

phpunit TddTests modules/tdd/TddTests.php 
<?php
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
class TddTests extends PHPUnit_Framework_TestCase
{
  public function test_tdd_help()
  {
    $this->assertEquals(
      tdd_help('admin/content/tdd'), "<p>Help for TDD module.</p>");
  }
}
?>

https://tlattimore.com/blog/using-phpunit-with-drupal-7/
https://drupal.stackexchange.com/questions/216827/debugging-a-custom-module-with-xdebug-and-phpunit
https://drupal.stackexchange.com/questions/129674/how-to-run-phpunit-tests

感觉DRUPAL7项目不太用得到PHPUNIT, 供参考。
---

Drupal7的前后端分离, services模块里面包含了rest_server模块,rest_service的目的就是提供了一个:
The REST Server provides an interface for the Services module to communicate with REST clients.

原文地址:https://www.cnblogs.com/qinqiu/p/10888395.html