summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/common.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests/common.test')
-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();