From e2e096985fa42336c196facdf087d6e754e6b2cc Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 22 Apr 2010 21:43:59 +0000 Subject: #746500 by eojthebrave: Fixed Overriding default image styles does not work with more than one effect and has potential to overwrite existing effects. --- modules/image/image.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/image/image.test') diff --git a/modules/image/image.test b/modules/image/image.test index 114cd59d5..fded5671d 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -536,6 +536,11 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase { $image_path = $this->createSampleImage($style); $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path))); + // Verify that effects attached to a default style do not have an ieid key. + foreach ($style['effects'] as $effect) { + $this->assertFalse(isset($effect['ieid']), t('The %effect effect does not have an ieid.', array('%effect' => $effect['name']))); + } + // Override the default. $this->drupalPost($edit_path, array(), t('Override defaults')); $this->assertRaw(t('The %style style has been overridden, allowing you to change its settings.', array('%style' => $style_name)), t('Default image style may be overridden.')); @@ -545,6 +550,11 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase { drupal_static_reset('image_styles'); $style = image_style_load($style_name); + // Verify that effects attached to the style have an ieid now. + foreach ($style['effects'] as $effect) { + $this->assertTrue(isset($effect['ieid']), t('The %effect effect has an ieid.', array('%effect' => $effect['name']))); + } + // The style should now have 2 effect, the original scale provided by core // and the desaturate effect we added in the override. $effects = array_values($style['effects']); -- cgit v1.2.3