diff --git a/modules/image/image.test b/modules/image/image.test index 87d803a..8c327d5 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -1094,6 +1094,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { // Add a default image to the public imagefield instance. $images = $this->drupalGetTestFiles('image'); $edit = array( + // Get the path of the 'image-test.png' file. 'files[field_settings_default_image]' => drupal_realpath($images[0]->uri), ); $this->drupalPost('admin/structure/types/manage/article/fields/' . $field_name, $edit, t('Save settings')); @@ -1107,8 +1108,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { $this->assertRaw($default_output, 'Default image displayed when no user supplied image is present.'); // Create a node with an image attached and ensure that the default image - // is not displayed. - $nid = $this->uploadNodeImage($images[1], $field_name, 'article'); + // is not displayed. Upload the 'image-test.gif' file. + $nid = $this->uploadNodeImage($images[2], $field_name, 'article'); $node = node_load($nid, NULL, TRUE); $image_info = array( 'path' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'], @@ -1135,7 +1136,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { $this->createImageField($private_field_name, 'article', array('uri_scheme' => 'private')); // Add a default image to the new field. $edit = array( - 'files[field_settings_default_image]' => drupal_realpath($images[1]->uri), + // Get the path of the 'image-test.gif' file. + 'files[field_settings_default_image]' => drupal_realpath($images[2]->uri), ); $this->drupalPost('admin/structure/types/manage/article/fields/' . $private_field_name, $edit, t('Save settings')); $private_field = field_info_field($private_field_name); diff --git a/modules/simpletest/tests/image.test b/modules/simpletest/tests/image.test index ac4d3cf..3b98240 100644 --- a/modules/simpletest/tests/image.test +++ b/modules/simpletest/tests/image.test @@ -514,9 +514,9 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase { $image->resource = imagecreatetruecolor(50, 20); $image->info['extension'] = 'gif'; $image->toolkit = 'gd'; - $resource = image_gd_create_tmp($image, 50, 20); - $color_index = imagecolorat($resource, 49, 0); - $color = array_values(imagecolorsforindex($resource, $color_index)); + $image->resource = image_gd_create_tmp($image, 50, 20); + $color_index = imagecolorat($image->resource, 49, 0); + $color = array_values(imagecolorsforindex($image->resource, $color_index)); $this->assertEqual($this->rotateTransparent, $color, "New GIF image with no transparent color set after creation has full transparent color at corner 1."); // Save image. $this->assertTrue(image_save($image, $file_path), format_string('New GIF image %file was saved.', array('%file' => $file)));