diff --git a/core/modules/image/image.test b/core/modules/image/image.test index 21eaca4a390..f2c9d2f0f5b 100644 --- a/core/modules/image/image.test +++ b/core/modules/image/image.test @@ -506,66 +506,6 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase { } - /** - * Test to override, edit, then revert a style. - */ - function testDefaultStyle() { - // Setup a style to be created and effects to add to it. - $style_name = 'thumbnail'; - $edit_path = 'admin/config/media/image-styles/edit/' . $style_name; - $delete_path = 'admin/config/media/image-styles/delete/' . $style_name; - $revert_path = 'admin/config/media/image-styles/revert/' . $style_name; - - // Create an image to make sure the default works before overriding. - drupal_static_reset('image_styles'); - $style = image_style_load($style_name); - $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.')); - - // Add sample effect to the overridden style. - $this->drupalPost($edit_path, array('new' => 'image_desaturate'), t('Add')); - 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']); - $this->assertEqual($effects[0]['name'], 'image_scale', t('The default effect still exists in the overridden style.')); - $this->assertEqual($effects[1]['name'], 'image_desaturate', t('The added effect exists in the overridden style.')); - - // Check that we are unable to rename an overridden style. - $this->drupalGet($edit_path); - $this->assertNoField('edit-name', t('Overridden styles may not be renamed.')); - - // Create an image to ensure the override works properly. - $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))); - - // Revert the image style. - $this->drupalPost($revert_path, array(), t('Revert')); - drupal_static_reset('image_styles'); - $style = image_style_load($style_name); - - // The style should now have the single effect for scale. - $effects = array_values($style['effects']); - $this->assertEqual($effects[0]['name'], 'image_scale', t('The default effect still exists in the reverted style.')); - $this->assertFalse(array_key_exists(1, $effects), t('The added effect has been removed in the reverted style.')); - } - /** * Test deleting a style and choosing a replacement style. */