summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/drupal_web_test_case.php6
-rw-r--r--modules/simpletest/tests/file.test6
2 files changed, 7 insertions, 5 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index e50adda62..514694160 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -799,12 +799,14 @@ class DrupalWebTestCase extends DrupalTestCase {
*
* @param title
* A node title, usually generated by $this->randomName().
+ * @param $reset
+ * (optional) Whether to reset the internal node_load() cache.
*
* @return
* A node object matching $title.
*/
- function drupalGetNodeByTitle($title) {
- $nodes = node_load_multiple(array(), array('title' => $title));
+ function drupalGetNodeByTitle($title, $reset = FALSE) {
+ $nodes = node_load_multiple(array(), array('title' => $title), $reset);
// Load the first node returned from the database.
$returned_node = reset($nodes);
return $returned_node;
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index 36a7170b2..c9577c6b2 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -1485,7 +1485,7 @@ class FileMoveTest extends FileHookTestCase {
$this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file correctly written.'));
// Check that the correct hooks were called.
- $this->assertFileHooksCalled(array('move', 'update'));
+ $this->assertFileHooksCalled(array('move', 'load', 'update'));
// Make sure we got the same file back.
$this->assertEqual($source->fid, $result->fid, t("Source file id's' %fid is unchanged after move.", array('%fid' => $source->fid)));
@@ -1517,7 +1517,7 @@ class FileMoveTest extends FileHookTestCase {
$this->assertEqual($contents, file_get_contents($result->uri), t('Contents of file correctly written.'));
// Check that the correct hooks were called.
- $this->assertFileHooksCalled(array('move', 'update'));
+ $this->assertFileHooksCalled(array('move', 'load', 'update'));
// Compare the returned value to what made it into the database.
$this->assertFileUnchanged($result, file_load($result->fid, TRUE));
@@ -1891,7 +1891,7 @@ class FileSaveTest extends FileHookTestCase {
$resaved_file = file_save($saved_file);
// Check that the correct hooks were called.
- $this->assertFileHooksCalled(array('update'));
+ $this->assertFileHooksCalled(array('load', 'update'));
$this->assertEqual($resaved_file->fid, $saved_file->fid, t("The file ID of an existing file is not changed when updating the database."), 'File');
$this->assertTrue($resaved_file->timestamp >= $saved_file->timestamp, t("Timestamp didn't go backwards."), 'File');