diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-05-01 08:12:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-05-01 08:12:23 +0000 |
commit | 71713081a2b79b0baa024742cdbb4af536f77f4b (patch) | |
tree | e9bc0d309856beb05a6fae67fdbdd75c59ccef9f /modules/field/tests | |
parent | 2a2f4cc0be547f515ccd4212e9aeca7765a4968b (diff) | |
download | brdo-71713081a2b79b0baa024742cdbb4af536f77f4b.tar.gz brdo-71713081a2b79b0baa024742cdbb4af536f77f4b.tar.bz2 |
- Patch #723802 by pwolanin, grendzy: convert to sha-256 and hmac from md5 and sha1.
Diffstat (limited to 'modules/field/tests')
-rw-r--r-- | modules/field/tests/field.test | 4 | ||||
-rw-r--r-- | modules/field/tests/field_test.module | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test index b24dc9ea7..378319a44 100644 --- a/modules/field/tests/field.test +++ b/modules/field/tests/field.test @@ -2715,7 +2715,7 @@ class FieldTranslationsTestCase extends FieldTestCase { $results = _field_invoke('test_op', $entity_type, $entity); foreach ($results as $langcode => $result) { - $hash = md5(serialize(array($entity_type, $entity, $this->field_name, $langcode, $values[$langcode]))); + $hash = hash('sha256', serialize(array($entity_type, $entity, $this->field_name, $langcode, $values[$langcode]))); // Check whether the parameters passed to _field_invoke() were correctly // forwarded to the callback function. $this->assertEqual($hash, $result, t('The result for %language is correctly stored.', array('%language' => $langcode))); @@ -2757,7 +2757,7 @@ class FieldTranslationsTestCase extends FieldTestCase { $grouped_results = _field_invoke_multiple('test_op_multiple', $entity_type, $entities); foreach ($grouped_results as $id => $results) { foreach ($results as $langcode => $result) { - $hash = md5(serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode]))); + $hash = hash('sha256', serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode]))); // Check whether the parameters passed to _field_invoke() were correctly // forwarded to the callback function. $this->assertEqual($hash, $result, t('The result for entity %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode))); diff --git a/modules/field/tests/field_test.module b/modules/field/tests/field_test.module index 51cd0df70..9403cac76 100644 --- a/modules/field/tests/field_test.module +++ b/modules/field/tests/field_test.module @@ -69,7 +69,7 @@ function field_test_menu() { * This simulates a field operation callback to be invoked by _field_invoke(). */ function field_test_field_test_op($entity_type, $entity, $field, $instance, $langcode, &$items) { - return array($langcode => md5(serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items)))); + return array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items)))); } /** @@ -81,7 +81,7 @@ function field_test_field_test_op($entity_type, $entity, $field, $instance, $lan function field_test_field_test_op_multiple($entity_type, $entities, $field, $instances, $langcode, &$items) { $result = array(); foreach ($entities as $id => $entity) { - $result[$id] = array($langcode => md5(serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id])))); + $result[$id] = array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id])))); } return $result; } |