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

merge-requests/26/head
Dries Buytaert 2009-12-28 14:00:01 +00:00
parent b057283bc3
commit 690c14e857
2 changed files with 6 additions and 5 deletions

View File

@ -826,7 +826,7 @@ class FileScanDirectoryTest extends FileTestCase {
function setUp() { function setUp() {
parent::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. * Check that the recurse option decends into subdirectories.
*/ */
function testOptionRecurse() { 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.")); $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.')); $this->assertEqual(2, count($files), t('With recursion we found the expected javascript files.'));
} }

View File

@ -21,7 +21,8 @@ class ImageToolkitTestCase extends DrupalWebTestCase {
$this->toolkit = 'test'; $this->toolkit = 'test';
// Pick a file for testing. // 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 // Setup a dummy image to work with, this replicate image_load() so we
// can avoid calling it. // can avoid calling it.
@ -382,7 +383,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase {
foreach ($files as $file) { foreach ($files as $file) {
foreach ($operations as $op => $values) { foreach ($operations as $op => $values) {
// Load up a fresh image. // 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) { if (!$image) {
$this->fail(t('Could not load image %file.', array('%file' => $file))); $this->fail(t('Could not load image %file.', array('%file' => $file)));
continue 2; continue 2;