diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-11-24 16:25:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-11-24 16:25:39 +0000 |
commit | b7459d8eb3def52ecdd35c65a55fac7e999f6cde (patch) | |
tree | 8b99154fbac3682e0bcdf4ddda196a64534400d5 /modules/node/tests/node_test.module | |
parent | 5eaf3e033fda5864b93b864ba2e97038ae2cec51 (diff) | |
download | brdo-b7459d8eb3def52ecdd35c65a55fac7e999f6cde.tar.gz brdo-b7459d8eb3def52ecdd35c65a55fac7e999f6cde.tar.bz2 |
- Patch #884948 by David_Rothstein: the wrong parameter is sometimes passed in to hook_node_load().
Diffstat (limited to 'modules/node/tests/node_test.module')
-rw-r--r-- | modules/node/tests/node_test.module | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/node/tests/node_test.module b/modules/node/tests/node_test.module index cfc503da0..c32bc1ec0 100644 --- a/modules/node/tests/node_test.module +++ b/modules/node/tests/node_test.module @@ -8,6 +8,22 @@ */ /** + * Implements hook_node_load(). + */ +function node_test_node_load($nodes, $types) { + // Add properties to each loaded node which record the parameters that were + // passed in to this function, so the tests can check that (a) this hook was + // called, and (b) the parameters were what we expected them to be. + $nids = array_keys($nodes); + ksort($nids); + sort($types); + foreach ($nodes as $node) { + $node->node_test_loaded_nids = $nids; + $node->node_test_loaded_types = $types; + } +} + +/** * Implements hook_node_view(). */ function node_test_node_view($node, $view_mode) { |