function ImageFieldTestCase::createRandomStyle

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 91

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,
    );
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.