function ImageAdminStylesUnitTest::createSampleImage
Given an image style, generate an image.
4 calls to ImageAdminStylesUnitTest::createSampleImage()
- ImageAdminStylesUnitTest::testDefaultStyle in drupal-7.x/
modules/ image/ image.test - Test to override, edit, then revert a style.
- ImageAdminStylesUnitTest::testDefaultStyle in drupal-7.x/
modules/ image/ image.test - Test to override, edit, then revert a style.
- ImageAdminStylesUnitTest::testStyle in drupal-7.x/
modules/ image/ image.test - General test to add a style, add/remove/edit effects to it, then delete it.
- ImageAdminStylesUnitTest::testStyle in drupal-7.x/
modules/ image/ image.test - General test to add a style, add/remove/edit effects to it, then delete it.
Archivo
- drupal-7.x/
modules/ image/ image.test, line 459 - Tests for image.module.
Class
- ImageAdminStylesUnitTest
- Tests creation, deletion, and editing of image styles and effects.
Código
function createSampleImage($style) {
static $file_path;
// First, we need to make sure we have an image in our testing
// file directory. Copy over an image on the first run.
if (!isset($file_path)) {
$files = $this->drupalGetTestFiles('image');
$file = reset($files);
$file_path = file_unmanaged_copy($file->uri);
}
return image_style_url($style['name'], $file_path) ? $file_path : FALSE;
}