Commit 690c14e8 authored by Dries's avatar Dries
Browse files

- Patch #667264 by Damien Tournoud: fixed some broken tests.

parent b057283b
......@@ -826,7 +826,7 @@ class FileScanDirectoryTest extends FileTestCase {
function setUp() {
parent::setUp();
$this->path = $this->originalFileDirectory . '/simpletest';
$this->path = drupal_get_path('module', 'simpletest') . '/files';
}
/**
......@@ -920,10 +920,10 @@ class FileScanDirectoryTest extends FileTestCase {
* Check that the recurse option decends into subdirectories.
*/
function testOptionRecurse() {
$files = file_scan_directory($this->originalFileDirectory, '/^javascript-/', array('recurse' => FALSE));
$files = file_scan_directory(drupal_get_path('module', 'simpletest'), '/^javascript-/', array('recurse' => FALSE));
$this->assertTrue(empty($files), t("Without recursion couldn't find javascript files."));
$files = file_scan_directory($this->originalFileDirectory, '/^javascript-/', array('recurse' => TRUE));
$files = file_scan_directory(drupal_get_path('module', 'simpletest'), '/^javascript-/', array('recurse' => TRUE));
$this->assertEqual(2, count($files), t('With recursion we found the expected javascript files.'));
}
......
......@@ -21,7 +21,8 @@ class ImageToolkitTestCase extends DrupalWebTestCase {
$this->toolkit = 'test';
// Pick a file for testing.
$this->file = $this->originalFileDirectory . '/simpletest/image-test.png';
$file = current($this->drupalGetTestFiles('image'));
$this->file = $file->uri;
// Setup a dummy image to work with, this replicate image_load() so we
// can avoid calling it.
......@@ -382,7 +383,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
foreach ($files as $file) {
foreach ($operations as $op => $values) {
// Load up a fresh image.
$image = image_load($this->originalFileDirectory . '/simpletest/' . $file, 'gd');
$image = image_load(drupal_get_path('module', 'simpletest') . '/files/' . $file, 'gd');
if (!$image) {
$this->fail(t('Could not load image %file.', array('%file' => $file)));
continue 2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment