Unverified Commit b89bd0c9 authored by alexpott's avatar alexpott

Issue #2863626 by vaplas, wengerk, mondrake, naveenvalecha, Lendude, nlisgo,...

Issue #2863626 by vaplas, wengerk, mondrake, naveenvalecha, Lendude, nlisgo, Jo Fitzgerald, claudiu.cristea, scuba_fly, mohit1604, dawehner, jonathan1055, alexpott: Convert web tests to browser tests for image module
parent 3c08a5b4
......@@ -2,6 +2,8 @@
namespace Drupal\image\Tests;
@trigger_error('The ' . __NAMESPACE__ . '\ImageFieldTestBase class is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Use \Drupal\Tests\image\Functional\ImageFieldTestBase instead. See https://www.drupal.org/node/2863626.', E_USER_DEPRECATED);
use Drupal\Tests\image\Kernel\ImageFieldCreationTrait;
use Drupal\simpletest\WebTestBase;
......
......@@ -12,213 +12,6 @@
*/
class ImageFieldValidateTest extends ImageFieldTestBase {
/**
* Test image validity.
*/
public function testValid() {
$file_system = $this->container->get('file_system');
$image_files = $this->drupalGetTestFiles('image');
$field_name = strtolower($this->randomMachineName());
$this->createImageField($field_name, 'article', [], ['file_directory' => 'test-upload']);
$expected_path = 'public://test-upload';
// Create alt text for the image.
$alt = $this->randomMachineName();
// Create a node with a valid image.
$node = $this->uploadNodeImage($image_files[0], $field_name, 'article', $alt);
$this->assertTrue(file_exists($expected_path . '/' . $image_files[0]->filename));
// Remove the image.
$this->drupalPostForm('node/' . $node . '/edit', [], t('Remove'));
$this->drupalPostForm(NULL, [], t('Save'));
// Get invalid image test files from simpletest.
$files = file_scan_directory(drupal_get_path('module', 'simpletest') . '/files', '/invalid-img-.*/');
$invalid_image_files = [];
foreach ($files as $file) {
$invalid_image_files[$file->filename] = $file;
}
// Try uploading a zero-byte image.
$zero_size_image = $invalid_image_files['invalid-img-zero-size.png'];
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($zero_size_image->uri),
];
$this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
$this->assertFalse(file_exists($expected_path . '/' . $zero_size_image->filename));
// Try uploading an invalid image.
$invalid_image = $invalid_image_files['invalid-img-test.png'];
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($invalid_image->uri),
];
$this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
$this->assertFalse(file_exists($expected_path . '/' . $invalid_image->filename));
// Upload a valid image again.
$valid_image = $image_files[0];
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($valid_image->uri),
];
$this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
$this->assertTrue(file_exists($expected_path . '/' . $valid_image->filename));
}
/**
* Test min/max resolution settings.
*/
public function testResolution() {
$field_names = [
0 => strtolower($this->randomMachineName()),
1 => strtolower($this->randomMachineName()),
2 => strtolower($this->randomMachineName()),
];
$min_resolution = [
'width' => 50,
'height' => 50
];
$max_resolution = [
'width' => 100,
'height' => 100
];
$no_height_min_resolution = [
'width' => 50,
'height' => NULL
];
$no_height_max_resolution = [
'width' => 100,
'height' => NULL
];
$no_width_min_resolution = [
'width' => NULL,
'height' => 50
];
$no_width_max_resolution = [
'width' => NULL,
'height' => 100
];
$field_settings = [
0 => $this->getFieldSettings($min_resolution, $max_resolution),
1 => $this->getFieldSettings($no_height_min_resolution, $no_height_max_resolution),
2 => $this->getFieldSettings($no_width_min_resolution, $no_width_max_resolution),
];
$this->createImageField($field_names[0], 'article', [], $field_settings[0]);
$this->createImageField($field_names[1], 'article', [], $field_settings[1]);
$this->createImageField($field_names[2], 'article', [], $field_settings[2]);
// We want a test image that is too small, and a test image that is too
// big, so cycle through test image files until we have what we need.
$image_that_is_too_big = FALSE;
$image_that_is_too_small = FALSE;
$image_factory = $this->container->get('image.factory');
foreach ($this->drupalGetTestFiles('image') as $image) {
$image_file = $image_factory->get($image->uri);
if ($image_file->getWidth() > $max_resolution['width']) {
$image_that_is_too_big = $image;
}
if ($image_file->getWidth() < $min_resolution['width']) {
$image_that_is_too_small = $image;
$image_that_is_too_small_file = $image_file;
}
if ($image_that_is_too_small && $image_that_is_too_big) {
break;
}
}
$this->uploadNodeImage($image_that_is_too_small, $field_names[0], 'article');
$this->assertRaw(t('The specified file %name could not be uploaded.', ['%name' => $image_that_is_too_small->filename]));
$this->assertRaw(t('The image is too small. The minimum dimensions are %dimensions pixels and the image size is %widthx%height pixels.', [
'%dimensions' => '50x50',
'%width' => $image_that_is_too_small_file->getWidth(),
'%height' => $image_that_is_too_small_file->getHeight(),
]));
$this->uploadNodeImage($image_that_is_too_big, $field_names[0], 'article');
$this->assertText(t('The image was resized to fit within the maximum allowed dimensions of 100x100 pixels.'));
$this->uploadNodeImage($image_that_is_too_small, $field_names[1], 'article');
$this->assertRaw(t('The specified file %name could not be uploaded.', ['%name' => $image_that_is_too_small->filename]));
$this->uploadNodeImage($image_that_is_too_big, $field_names[1], 'article');
$this->assertText(t('The image was resized to fit within the maximum allowed width of 100 pixels.'));
$this->uploadNodeImage($image_that_is_too_small, $field_names[2], 'article');
$this->assertRaw(t('The specified file %name could not be uploaded.', ['%name' => $image_that_is_too_small->filename]));
$this->uploadNodeImage($image_that_is_too_big, $field_names[2], 'article');
$this->assertText(t('The image was resized to fit within the maximum allowed height of 100 pixels.'));
}
/**
* Test that required alt/title fields gets validated right.
*/
public function testRequiredAttributes() {
$field_name = strtolower($this->randomMachineName());
$field_settings = [
'alt_field' => 1,
'alt_field_required' => 1,
'title_field' => 1,
'title_field_required' => 1,
'required' => 1,
];
$instance = $this->createImageField($field_name, 'article', [], $field_settings);
$images = $this->drupalGetTestFiles('image');
// Let's just use the first image.
$image = $images[0];
$this->uploadNodeImage($image, $field_name, 'article');
// Look for form-required for the alt text.
$elements = $this->xpath('//label[@for="edit-' . $field_name . '-0-alt" and @class="js-form-required form-required"]/following-sibling::input[@id="edit-' . $field_name . '-0-alt"]');
$this->assertTrue(isset($elements[0]), 'Required marker is shown for the required alt text.');
$elements = $this->xpath('//label[@for="edit-' . $field_name . '-0-title" and @class="js-form-required form-required"]/following-sibling::input[@id="edit-' . $field_name . '-0-title"]');
$this->assertTrue(isset($elements[0]), 'Required marker is shown for the required title text.');
$this->assertText(t('Alternative text field is required.'));
$this->assertText(t('Title field is required.'));
$instance->setSetting('alt_field_required', 0);
$instance->setSetting('title_field_required', 0);
$instance->save();
$edit = [
'title[0][value]' => $this->randomMachineName(),
];
$this->drupalPostForm('node/add/article', $edit, t('Save'));
$this->assertNoText(t('Alternative text field is required.'));
$this->assertNoText(t('Title field is required.'));
$instance->setSetting('required', 0);
$instance->setSetting('alt_field_required', 1);
$instance->setSetting('title_field_required', 1);
$instance->save();
$edit = [
'title[0][value]' => $this->randomMachineName(),
];
$this->drupalPostForm('node/add/article', $edit, t('Save'));
$this->assertNoText(t('Alternative text field is required.'));
$this->assertNoText(t('Title field is required.'));
}
/**
* Returns field settings.
*
* @param int[] $min_resolution
* The minimum width and height resolution setting.
* @param int[] $max_resolution
* The maximum width and height resolution setting.
*
* @return array
*/
protected function getFieldSettings($min_resolution, $max_resolution) {
return [
'max_resolution' => $max_resolution['width'] . 'x' . $max_resolution['height'],
'min_resolution' => $min_resolution['width'] . 'x' . $min_resolution['height'],
'alt_field' => 0,
];
}
/**
* Test the validation message is displayed only once for ajax uploads.
*/
......
<?php
namespace Drupal\image\Tests;
namespace Drupal\Tests\image\Functional;
use Drupal\file\Entity\File;
use Drupal\simpletest\WebTestBase;
use Drupal\image\Entity\ImageStyle;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests the file move function for images and image styles.
*
* @group image
*/
class FileMoveTest extends WebTestBase {
class FileMoveTest extends BrowserTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
compareFiles as drupalCompareFiles;
}
/**
* Modules to enable.
......
<?php
namespace Drupal\image\Tests;
namespace Drupal\Tests\image\Functional;
use Drupal\image\Entity\ImageStyle;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests that images have correct dimensions when styled.
*
* @group image
*/
class ImageDimensionsTest extends WebTestBase {
class ImageDimensionsTest extends BrowserTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
compareFiles as drupalCompareFiles;
}
/**
* Modules to enable.
......
<?php
namespace Drupal\image\Tests;
namespace Drupal\Tests\image\Functional;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\field\Entity\FieldConfig;
use Drupal\file\Entity\File;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\Tests\EntityViewTrait;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests setting up default images both to the field and field storage.
......@@ -15,6 +17,14 @@
*/
class ImageFieldDefaultImagesTest extends ImageFieldTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
compareFiles as drupalCompareFiles;
}
use EntityViewTrait {
buildEntityView as drupalBuildEntityView;
}
/**
* Modules to enable.
*
......
<?php
namespace Drupal\image\Tests;
namespace Drupal\Tests\image\Functional;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\Tests\TestFileCreationTrait;
use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait;
use Drupal\user\RoleInterface;
use Drupal\image\Entity\ImageStyle;
......@@ -14,6 +16,12 @@
*/
class ImageFieldDisplayTest extends ImageFieldTestBase {
use AssertPageCacheContextsAndTagsTrait;
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
compareFiles as drupalCompareFiles;
}
protected $dumpHeaders = TRUE;
/**
......@@ -54,7 +62,7 @@ public function _testImageFieldFormatters($scheme) {
$this->drupalGet("admin/structure/types/manage/article/display");
// Test for existence of link to image styles configuration.
$this->drupalPostAjaxForm(NULL, [], "{$field_name}_settings_edit");
$this->drupalPostForm(NULL, [], "{$field_name}_settings_edit");
$this->assertLinkByHref(\Drupal::url('entity.image_style.collection'), 0, 'Link to image styles configuration is found');
// Remove 'administer image styles' permission from testing admin user.
......@@ -65,7 +73,7 @@ public function _testImageFieldFormatters($scheme) {
$this->drupalGet("admin/structure/types/manage/article/display");
// Test for absence of link to image styles configuration.
$this->drupalPostAjaxForm(NULL, [], "{$field_name}_settings_edit");
$this->drupalPostForm(NULL, [], "{$field_name}_settings_edit");
$this->assertNoLinkByHref(\Drupal::url('entity.image_style.collection'), 'Link to image styles configuration is absent when permissions are insufficient');
// Restore 'administer image styles' permission to testing admin user
......@@ -258,8 +266,11 @@ public function testImageFieldSettings() {
$nid = $this->uploadNodeImage($test_image, $field_name, 'article', $alt);
$this->drupalGet('node/' . $nid . '/edit');
$this->assertFieldByName($field_name . '[0][alt]', '', 'Alt field displayed on article form.');
// Verify that the optional fields alt & title are saved & filled.
$this->assertFieldByName($field_name . '[0][alt]', $alt, 'Alt field displayed on article form.');
$this->assertFieldByName($field_name . '[0][title]', '', 'Title field displayed on article form.');
// Verify that the attached image is being previewed using the 'medium'
// style.
$node_storage->resetCache([$nid]);
......@@ -324,9 +335,9 @@ public function testImageFieldSettings() {
$edit = [
'files[' . $field_name . '_2][]' => \Drupal::service('file_system')->realpath($test_image->uri),
];
$this->drupalPostAjaxForm(NULL, $edit, $field_name . '_2_upload_button');
$this->assertNoRaw('<input multiple type="file" id="edit-' . strtr($field_name, '_', '-') . '-2-upload" name="files[' . $field_name . '_2][]" size="22" class="js-form-file form-file">');
$this->assertRaw('<input multiple type="file" id="edit-' . strtr($field_name, '_', '-') . '-3-upload" name="files[' . $field_name . '_3][]" size="22" class="js-form-file form-file">');
$this->drupalPostForm(NULL, $edit, $field_name . '_2_upload_button');
$this->assertSession()->elementNotExists('css', 'input[name="files[' . $field_name . '_2][]"]');
$this->assertSession()->elementExists('css', 'input[name="files[' . $field_name . '_3][]"]');
}
/**
......@@ -410,10 +421,11 @@ public function testImageFieldDefaultImage() {
$this->assertRaw($image_output, 'User supplied image is displayed.');
// Remove default image from the field and make sure it is no longer used.
$edit = [
'settings[default_image][uuid][fids]' => 0,
];
$this->drupalPostForm("admin/structure/types/manage/article/fields/node.article.$field_name/storage", $edit, t('Save field settings'));
// Can't use fillField cause Mink can't fill hidden fields.
$this->drupalGet("admin/structure/types/manage/article/fields/node.article.$field_name/storage");
$this->getSession()->getPage()->find('css', 'input[name="settings[default_image][uuid][fids]"]')->setValue(0);
$this->getSession()->getPage()->pressButton(t('Save field settings'));
// Clear field definition cache so the new default image is detected.
\Drupal::entityManager()->clearCachedFieldDefinitions();
$field_storage = FieldStorageConfig::loadByName('node', $field_name);
......
......@@ -87,10 +87,10 @@ public function uploadNodeImage($image, $field_name, $type, $alt = '') {
'title[0][value]' => $this->randomMachineName(),
];
$edit['files[' . $field_name . '_0]'] = \Drupal::service('file_system')->realpath($image->uri);
$this->drupalPostForm('node/add/' . $type, $edit, t('Save and publish'));
$this->drupalPostForm('node/add/' . $type, $edit, t('Save'));
if ($alt) {
// Add alt text.
$this->drupalPostForm(NULL, [$field_name . '[0][alt]' => $alt], t('Save and publish'));
$this->drupalPostForm(NULL, [$field_name . '[0][alt]' => $alt], t('Save'));
}
// Retrieve ID of the newly created node from the current URL.
......
<?php
namespace Drupal\Tests\image\Functional;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests validation functions such as min/max resolution.
*
* @group image
*/
class ImageFieldValidateTest extends ImageFieldTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
compareFiles as drupalCompareFiles;
}
/**
* Test image validity.
*/
public function testValid() {
$file_system = $this->container->get('file_system');
$image_files = $this->drupalGetTestFiles('image');
$field_name = strtolower($this->randomMachineName());
$this->createImageField($field_name, 'article', [], ['file_directory' => 'test-upload']);
$expected_path = 'public://test-upload';
// Create alt text for the image.
$alt = $this->randomMachineName();
// Create a node with a valid image.
$node = $this->uploadNodeImage($image_files[0], $field_name, 'article', $alt);
$this->assertTrue(file_exists($expected_path . '/' . $image_files[0]->filename));
// Remove the image.
$this->drupalPostForm('node/' . $node . '/edit', [], t('Remove'));
$this->drupalPostForm(NULL, [], t('Save'));
// Get invalid image test files from simpletest.
$files = file_scan_directory(drupal_get_path('module', 'simpletest') . '/files', '/invalid-img-.*/');
$invalid_image_files = [];
foreach ($files as $file) {
$invalid_image_files[$file->filename] = $file;
}
// Try uploading a zero-byte image.
$zero_size_image = $invalid_image_files['invalid-img-zero-size.png'];
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($zero_size_image->uri),
];
$this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
$this->assertFalse(file_exists($expected_path . '/' . $zero_size_image->filename));
// Try uploading an invalid image.
$invalid_image = $invalid_image_files['invalid-img-test.png'];
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($invalid_image->uri),
];
$this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
$this->assertFalse(file_exists($expected_path . '/' . $invalid_image->filename));
// Upload a valid image again.
$valid_image = $image_files[0];
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($valid_image->uri),
];
$this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
$this->assertTrue(file_exists($expected_path . '/' . $valid_image->filename));
}
/**
* Test min/max resolution settings.
*/
public function testResolution() {
$field_names = [
0 => strtolower($this->randomMachineName()),
1 => strtolower($this->randomMachineName()),
2 => strtolower($this->randomMachineName()),
];
$min_resolution = [
'width' => 50,
'height' => 50
];
$max_resolution = [
'width' => 100,
'height' => 100
];
$no_height_min_resolution = [
'width' => 50,
'height' => NULL
];
$no_height_max_resolution = [
'width' => 100,
'height' => NULL
];
$no_width_min_resolution = [
'width' => NULL,
'height' => 50
];
$no_width_max_resolution = [
'width' => NULL,
'height' => 100
];
$field_settings = [
0 => $this->getFieldSettings($min_resolution, $max_resolution),
1 => $this->getFieldSettings($no_height_min_resolution, $no_height_max_resolution),
2 => $this->getFieldSettings($no_width_min_resolution, $no_width_max_resolution),
];
$this->createImageField($field_names[0], 'article', [], $field_settings[0]);
$this->createImageField($field_names[1], 'article', [], $field_settings[1]);
$this->createImageField($field_names[2], 'article', [], $field_settings[2]);
// We want a test image that is too small, and a test image that is too
// big, so cycle through test image files until we have what we need.
$image_that_is_too_big = FALSE;
$image_that_is_too_small = FALSE;
$image_factory = $this->container->get('image.factory');
foreach ($this->drupalGetTestFiles('image') as $image) {
$image_file = $image_factory->get($image->uri);
if ($image_file->getWidth() > $max_resolution['width']) {
$image_that_is_too_big = $image;
}
if ($image_file->getWidth() < $min_resolution['width']) {
$image_that_is_too_small = $image;
$image_that_is_too_small_file = $image_file;
}
if ($image_that_is_too_small && $image_that_is_too_big) {
break;
}
}
$this->uploadNodeImage($image_that_is_too_small, $field_names[0], 'article');
$this->assertRaw(t('The specified file %name could not be uploaded.', ['%name' => $image_that_is_too_small->filename]));
$this->assertRaw(t('The image is too small. The minimum dimensions are %dimensions pixels and the image size is %widthx%height pixels.', [
'%dimensions' => '50x50',
'%width' => $image_that_is_too_small_file->getWidth(),
'%height' => $image_that_is_too_small_file->getHeight(),
]));
$this->uploadNodeImage($image_that_is_too_big, $field_names[0], 'article');
$this->assertText(t('The image was resized to fit within the maximum allowed dimensions of 100x100 pixels.'));
$this->uploadNodeImage($image_that_is_too_small, $field_names[1], 'article');
$this->assertRaw(t('The specified file %name could not be uploaded.', ['%name' => $image_that_is_too_small->filename]));
$this->uploadNodeImage($image_that_is_too_big, $field_names[1], 'article');
$this->assertText(t('The image was resized to fit within the maximum allowed width of 100 pixels.'));
$this->uploadNodeImage($image_that_is_too_small, $field_names[2], 'article');
$this->assertRaw(t('The specified file %name could not be uploaded.', ['%name' => $image_that_is_too_small->filename]));
$this->uploadNodeImage($image_that_is_too_big, $field_names[2], 'article');
$this->assertText(t('The image was resized to fit within the maximum allowed height of 100 pixels.'));
}
/**
* Test that required alt/title fields gets validated right.
*/
public function testRequiredAttributes() {
$field_name = strtolower($this->randomMachineName());
$field_settings = [
'alt_field' => 1,
'alt_field_required' => 1,
'title_field' => 1,
'title_field_required' => 1,
'required' => 1,
];
$instance = $this->createImageField($field_name, 'article', [], $field_settings);
$images = $this->drupalGetTestFiles('image');
// Let's just use the first image.
$image = $images[0];
$this->uploadNodeImage($image, $field_name, 'article');
// Look for form-required for the alt text.
$elements = $this->xpath('//label[@for="edit-' . $field_name . '-0-alt" and @class="js-form-required form-required"]/following-sibling::input[@id="edit-' . $field_name . '-0-alt"]');
$this->assertTrue(isset($elements[0]), 'Required marker is shown for the required alt text.');
$elements = $this->xpath('//label[@for="edit-' . $field_name . '-0-title" and @class="js-form-required form-required"]/following-sibling::input[@id="edit-' . $field_name . '-0-title"]');
$this->assertTrue(isset($elements[0]), 'Required marker is shown for the required title text.');
$this->assertText(t('Alternative text field is required.'));
$this->assertText(t('Title field is required.'));
$instance->setSetting('alt_field_required', 0);
$instance->setSetting('title_field_required', 0);
$instance->save();
$edit = [
'title[0][value]' => $this->randomMachineName(),
];
$this->drupalPostForm('node/add/article', $edit, t('Save'));
$this->assertNoText(t('Alternative text field is required.'));
$this->assertNoText(t('Title field is required.'));
$instance->setSetting('required', 0);
$instance->setSetting('alt_field_required', 1);
$instance->setSetting('title_field_required', 1);
$instance->save();
$edit = [
'title[0][value]' => $this->randomMachineName(),
];
$this->drupalPostForm('node/add/article', $edit, t('Save'));
$this->assertNoText(t('Alternative text field is required.'));
$this->assertNoText(t('Title field is required.'));
}
/**
* Returns field settings.
*
* @param int[] $min_resolution
* The minimum width and height resolution setting.
* @param int[] $max_resolution
* The maximum width and height resolution setting.
*
* @return array
*/
protected function getFieldSettings($min_resolution, $max_resolution) {
return [
'max_resolution' => $max_resolution['width'] . 'x' . $max_resolution['height'],
'min_resolution' => $min_resolution['width'] . 'x' . $min_resolution['height'],
'alt_field' => 0,
];
}
}
<?php
namespace Drupal\image\Tests;
namespace Drupal\Tests\image\Functional;
use Drupal\file\Entity\File;
use Drupal\Tests\TestFileCreationTrait;
/**
* Uploads images to translated nodes.
......@@ -11,6 +12,11 @@
*/
class ImageOnTranslatedEntityTest extends ImageFieldTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
compareFiles as drupalCompareFiles;
}
/**
* {@inheritdoc}
*/
......
<?php
namespace Drupal\image\Tests;
namespace Drupal\Tests\image\Functional;
use Drupal\image\Entity\ImageStyle;
use Drupal\Tests\TestFileCreationTrait;
/**
* Tests flushing of image styles.
......@@ -11,6 +12,11 @@
*/
class ImageStyleFlushTest extends ImageFieldTestBase {
use TestFileCreationTrait {
getTestFiles as drupalGetTestFiles;
compareFiles as drupalCompareFiles;
}
/**
* Given an image style and a wrapper, generate an image.
*/
......