From 06c5979961971394c0451f07f5280b30906677c8 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 6 Dec 2009 17:01:52 +0000 Subject: #626790 by justinrandell: Fixed bug where drupal_write_record() returns FALSE for valid update queries. --- modules/simpletest/tests/common.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/simpletest') 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(); -- cgit v1.2.3