You are here

function ImageFieldTestCase::createRandomStyle in Drupal 7

Create a random style.

Return value

array A list containing the details of the generated image style.

2 calls to ImageFieldTestCase::createRandomStyle()
ImageAdminUiTestCase::testAddEffectHelpText in modules/image/image.test
Test if the help text is available on the add effect form.
ImageAdminUiTestCase::testEditEffectHelpText in modules/image/image.test
Test if the help text is available on the edit effect form.

File

modules/image/image.test, line 86
Tests for image.module.

Class

ImageFieldTestCase
This class provides methods specifically for testing Image's field handling.

Code

function createRandomStyle() {
  $style_name = strtolower($this
    ->randomName(10));
  $style_label = $this
    ->randomString();
  image_style_save(array(
    'name' => $style_name,
    'label' => $style_label,
  ));
  $style_path = 'admin/config/media/image-styles/edit/' . $style_name;
  return array(
    'name' => $style_name,
    'label' => $style_label,
    'path' => $style_path,
  );
}