Example: Simpletest

  1. drupal
    1. 8
    2. 6
    3. 7

An example of simpletest tests to accompany the tutorial at http://drupal.org/node/890654.

This is built on a traditional node-type implementation.

Functions & methods

NameDescription
simpletest_example_empty_mysql_dateA simple self-contained function used to demonstrate unit tests.
simpletest_example_formImplements hook_form().
simpletest_example_menuImplements hook_menu().
simpletest_example_node_accessImplements hook_node_access().
simpletest_example_node_infoImplements hook_node_info().
simpletest_example_permissionImplements hook_permission().
_simpletest_example_explanationReturns an explanation of this module.

examples/simpletest_example/simpletest_example.module, line 8