ImageImportTest.php in Zircon Profile 8
Same filename and directory in other branches
Contains \Drupal\image\Tests\ImageImportTest.
Namespace
Drupal\image\TestsFile
core/modules/image/src/Tests/ImageImportTest.phpView source
<?php
/**
* @file
* Contains \Drupal\image\Tests\ImageImportTest.
*/
namespace Drupal\image\Tests;
use Drupal\image\Entity\ImageStyle;
use Drupal\simpletest\KernelTestBase;
/**
* Tests config import for Image styles.
*
* @group image
*/
class ImageImportTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'system',
'image',
'image_module_test',
];
/**
* Tests importing image styles.
*/
public function testImport() {
$style = ImageStyle::create([
'name' => 'test',
]);
$style
->addImageEffect([
'id' => 'image_module_test_null',
]);
$style
->addImageEffect([
'id' => 'image_module_test_null',
]);
$style
->save();
$this
->assertEqual(count($style
->getEffects()), 2);
$uuid = \Drupal::service('uuid')
->generate();
$style
->set('effects', [
$uuid => [
'id' => 'image_module_test_null',
],
]);
$style
->save();
$style = ImageStyle::load('test');
$this
->assertEqual(count($style
->getEffects()), 1);
}
}
Classes
Name | Description |
---|---|
ImageImportTest | Tests config import for Image styles. |