summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-06 17:01:52 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-12-06 17:01:52 +0000
commit06c5979961971394c0451f07f5280b30906677c8 (patch)
tree15b7ca6217fe562773b4d2bd793ff410de54a646 /modules
parentb12a25d24f68d7bfb44240cd84dcfc54c17e3009 (diff)
downloadbrdo-06c5979961971394c0451f07f5280b30906677c8.tar.gz
brdo-06c5979961971394c0451f07f5280b30906677c8.tar.bz2
#626790 by justinrandell: Fixed bug where drupal_write_record() returns FALSE for valid update queries.
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/common.test6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 8b2e24e21..35a2a7f87 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -1476,6 +1476,12 @@ class DrupalDataApiTest extends DrupalWebTestCase {
$update_result = drupal_write_record('taxonomy_vocabulary', $vocabulary, array('vid'));
$this->assertTrue($update_result == SAVED_UPDATED, t('Correct value returned when a record updated with drupal_write_record() for table with single-field primary key.'));
+ // Run an update query where no field values are changed. The database
+ // layer should return zero for number of affected rows, but
+ // db_write_record() should still return SAVED_UPDATED.
+ $update_result = drupal_write_record('taxonomy_vocabulary', $vocabulary, array('vid'));
+ $this->assertTrue($update_result == SAVED_UPDATED, t('Correct value returned when a valid update is run without changing any values.'));
+
// Insert an object record for a table with a multi-field primary key.
$node_access = new stdClass();
$node_access->nid = mt_rand();