Community Documentation

Search for example

Classes

NameLocationDescription
ActionExampleTestCaseaction_example/action_example.testDefault test case for the action_example module.
AjaxExampleTestCaseajax_example/ajax_example.test@file Test ajax example module.
BatchExampleTestCasebatch_example/batch_example.test@file Test case for Testing the batch example module.
BlockExampleTestCaseblock_example/block_example.test@file Test case for testing the block example module.
CacheExampleTestCasecache_example/cache_example.test@file Test case for testing the cache example module.
ContextualLinksExampleTestCasecontextual_links_example/contextual_links_example.test@file Tests for the contextual links example module.
CronExampleTestCasecron_example/cron_example.testcron_example test class
DBTNGExampleUnitTestCasedbtng_example/dbtng_example.testDefault test case for the dbtng_example module.
EmailExampleTestCaseemail_example/email_example.testFunctionality tests for email example module.
FieldExampleTestfield_example/field_example.test
FileExampleSessionStreamWrapperfile_example/file_example_session_streams.incExample stream wrapper class to handle session:// streams.
FileExampleTestfile_example/file_example.test
FilterExampleTestCasefilter_example/filter_example.test@file Test case for Testing the filter example module.
FormExampleTestCaseform_example/form_example.testDefault test case for the form_example module.
ImageExampleTestCaseimage_example/image_example.test@file Test case for testing the image example module.
MenuExampleTestCasemenu_example/menu_example.test@file Tests for menu example module.
NodeAccessExampleTestCasenode_access_example/node_access_example.test@file Tests for Node Access example module.
NodeApiExampleTestCasenodeapi_example/nodeapi_example.test@file Test case for Testing the node API example module.
NodeExampleTestCasenode_example/node_example.testFunctionality tests for node example module.
PageExampleTestCasepage_example/page_example.test@file Test case for Testing the page example module.
PagerExampleTestCasepager_example/pager_example.testFunctionality tests for the pager example module.
QueueExampleTestCasequeue_example/queue_example.test@file Test the queue example module.
RenderExampleTestCaserender_example/render_example.test@file Test for the render example module.
SimpletestExampleTestCasesimpletest_example/simpletest_example.testThe SimpletestExampleTestCase is a functional test case, meaning that it actually exercises a particular sequence of actions through the web UI. The majority of core test cases are done this way, but the Simpletest suite also provides unit tests as…
SimpletestUnitTestExampleTestCasesimpletest_example/simpletest_example.testAlthough most core test cases are based on DrupalWebTestCase and are functional tests (exercising the web UI) we also have DrupalUnitTestCase, which executes much faster because a Drupal install does not have to be one. No environment is provided to a…
TableSortExampleTestCasetablesort_example/tablesort_example.testFunctionality tests for the tablesort example module.
ThemingExampleTestCasetheming_example/theming_example.testFunctionality tests for the theming example module.
TokenExampleTestCasetoken_example/token_example.test
TriggerExampleTestCasetrigger_example/trigger_example.testDefault test case for the trigger_example module.
XmlrpcExampleTestCasexmlrpc_example/xmlrpc_example.test@file Test case for the XML-RPC example module.

Constants

NameLocationDescription
NODE_ACCESS_EXAMPLE_GRANT_ALLnode_access_example/node_access_example.moduleHere we define a constant for our node access grant ID, for the node_access_example_view and node_access_example_edit realms. This ID could be any integer, but here we choose 23, because it is this author's favorite number.

Files

NameLocationDescription
action_example.moduleaction_example/action_example.moduleAction definition example module.
action_example.testaction_example/action_example.testtest file for action_example module.
ajax_example.installajax_example/ajax_example.installAJAX Examples install file schema for ajax_example_form_node_form_alter()
ajax_example.moduleajax_example/ajax_example.moduleAJAX Examples module file with basic examples.
ajax_example.testajax_example/ajax_example.testTest ajax example module.
ajax_example_advanced.incajax_example/ajax_example_advanced.incAJAX Commands examples.
ajax_example_graceful_degradation.incajax_example/ajax_example_graceful_degradation.incDemonstrations of AJAX with graceful degradation.
ajax_example_misc.incajax_example/ajax_example_misc.incAJAX Miscellaneous Topics.
ajax_example_node_form_alter.incajax_example/ajax_example_node_form_alter.incThis example shows how to use AJAX when altering a node form.
batch_example.installbatch_example/batch_example.installInstall, update, and uninstall functions for the batch_example module.
batch_example.modulebatch_example/batch_example.moduleOutlines how a module can use the Batch API.
batch_example.testbatch_example/batch_example.testTest case for Testing the batch example module.
block_example.installblock_example/block_example.installInstall, update and uninstall functions for the block_example module.
block_example.moduleblock_example/block_example.moduleModule file for block_example.
block_example.testblock_example/block_example.testTest case for testing the block example module.
cache_example.modulecache_example/cache_example.moduleOutlines how a module can use the Cache API.
cache_example.testcache_example/cache_example.testTest case for testing the cache example module.
contextual-links-example-object.tpl.phpcontextual_links_example/contextual-links-example-object.tpl.phpDefault theme implementation to display a sample object with contextual links.
contextual_links_example.modulecontextual_links_example/contextual_links_example.moduleShows how to use Drupal's contextual links functionality.