Given an image style, generate an image.
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
->id(), $file_path) ? $file_path : FALSE;
}