1 image.test public ImageAdminStylesUnitTest::testNumericStyleName()

Test creating an image style with a numeric name and ensuring it can be applied to an image.

File

core/modules/image/tests/image.test, line 427
Tests for image.module.

Class

ImageAdminStylesUnitTest
Tests creation, deletion, and editing of image styles and effects.

Code

public function testNumericStyleName() {
  $style_name = rand();
  $style_label = $this->randomName();
  $edit = array(
    'name' => $style_name,
    'label' => $style_label,
  );
  $this->backdropPost('admin/config/media/image-styles/add', $edit, t('Save and add effects'));
  $this->assertRaw(t('Style %label was created.', array('%label' => $style_label)), 'Image style successfully created.');
  backdrop_static_reset('image_styles');
  $options = image_style_options();
  $this->assertTrue(array_key_exists($style_name, $options), format_string('Array key %key exists.', array('%key' => $style_name)));
}