summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/drupal_web_test_case.php2
-rw-r--r--modules/simpletest/tests/file.test4
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 323825ac2..36568a8d4 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -939,7 +939,7 @@ class DrupalWebTestCase extends DrupalTestCase {
$files = array();
// Make sure type is valid.
if (in_array($type, array('binary', 'html', 'image', 'javascript', 'php', 'sql', 'text'))) {
- $files = file_scan_directory(variable_get('file_public_path', conf_path() . '/files'), '/' . $type . '\-.*/');
+ $files = file_scan_directory('public://', '/' . $type . '\-.*/');
// If size is set then remove any files that are not of that size.
if ($size !== NULL) {
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index 7d3c7bccc..f8c72ac63 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -575,7 +575,9 @@ class FileSaveUploadTest extends FileHookTestCase {
$account = $this->drupalCreateUser(array('access content'));
$this->drupalLogin($account);
- $this->image = current($this->drupalGetTestFiles('image'));
+ $image_files = $this->drupalGetTestFiles('image');
+ $this->image = current($image_files);
+
list(, $this->image_extension) = explode('.', $this->image->filename);
$this->assertTrue(is_file($this->image->uri), t("The image file we're going to upload exists."));