You are here

private function ConfigEntityDependencyCollectorTest::createImageStyle in Dependency Calculation 8

Creates a dummy image style.

Parameters

string $name: Image style name.

Return value

\Drupal\image\ImageStyleInterface Image style.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to ConfigEntityDependencyCollectorTest::createImageStyle()
ConfigEntityDependencyCollectorTest::testConfigEntitiesDependencyCalculation in tests/src/Kernel/EventSubscriber/DependencyCollector/ConfigEntityDependencyCollectorTest.php
Tests config entities dependency calculation.

File

tests/src/Kernel/EventSubscriber/DependencyCollector/ConfigEntityDependencyCollectorTest.php, line 202

Class

ConfigEntityDependencyCollectorTest
Class ConfigEntityDependencyCollector.

Namespace

Drupal\Tests\depcalc\Kernel\EventSubscriber\DependencyCollector

Code

private function createImageStyle(string $name) : EntityInterface {
  $style = ImageStyle::create([
    'name' => $name,
    'label' => $this
      ->randomString(),
  ]);
  $style
    ->save();
  return $style;
}