diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-06-24 17:24:40 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-06-24 17:24:40 +0000 |
commit | 2d9fd20acc7c9e668c0f04e1486771227205a41e (patch) | |
tree | 99f396458cd1749f9d020ea83264a147afcef182 /modules/field/tests | |
parent | a1f25d312f628bb09acf1c7c06566fc37776412b (diff) | |
download | brdo-2d9fd20acc7c9e668c0f04e1486771227205a41e.tar.gz brdo-2d9fd20acc7c9e668c0f04e1486771227205a41e.tar.bz2 |
#834842 by Damien Tournoud, chx: Fixed oversight in field query routing API, and added tests.
Diffstat (limited to 'modules/field/tests')
-rw-r--r-- | modules/field/tests/field_test.module | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/field/tests/field_test.module b/modules/field/tests/field_test.module index 9403cac76..2eac091e2 100644 --- a/modules/field/tests/field_test.module +++ b/modules/field/tests/field_test.module @@ -191,3 +191,24 @@ function field_test_field_delete($entity_type, $entity, $field, $instance, $item $args = func_get_args(); field_test_memorize(__FUNCTION__, $args); } + +/** + * Implements hook_entity_query_alter(). + */ +function field_test_entity_query_alter(&$query) { + if (!empty($query->alterMyExecuteCallbackPlease)) { + $query->executeCallback = 'field_test_dummy_field_storage_query'; + } +} + +/** + * Pseudo-implements hook_field_storage_query(). + */ +function field_test_dummy_field_storage_query(EntityFieldQuery $query) { + // Return dummy values that will be checked by the test. + return array( + 'user' => array( + 1 => entity_create_stub_entity('user', array(1, NULL, NULL)), + ), + ); +} |