You are here

protected function ImageStyleTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/image/tests/src/Unit/ImageStyleTest.php \Drupal\Tests\image\Unit\ImageStyleTest::setUp()
  2. 9 core/modules/image/tests/src/Unit/ImageStyleTest.php \Drupal\Tests\image\Unit\ImageStyleTest::setUp()

File

core/modules/image/tests/src/Unit/ImageStyleTest.php, line 79

Class

ImageStyleTest
@coversDefaultClass \Drupal\image\Entity\ImageStyle

Namespace

Drupal\Tests\image\Unit

Code

protected function setUp() : void {
  $this->entityTypeId = $this
    ->randomMachineName();
  $provider = $this
    ->randomMachineName();
  $this->entityType = $this
    ->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
  $this->entityType
    ->expects($this
    ->any())
    ->method('getProvider')
    ->will($this
    ->returnValue($provider));
  $this->entityTypeManager = $this
    ->createMock('\\Drupal\\Core\\Entity\\EntityTypeManagerInterface');
  $this->entityTypeManager
    ->expects($this
    ->any())
    ->method('getDefinition')
    ->with($this->entityTypeId)
    ->will($this
    ->returnValue($this->entityType));
}