function ImageStyleTest::setUp

Same name and namespace in other branches
  1. 8.9.x core/modules/image/tests/src/Unit/ImageStyleTest.php \Drupal\Tests\image\Unit\ImageStyleTest::setUp()
  2. 10 core/modules/image/tests/src/Unit/ImageStyleTest.php \Drupal\Tests\image\Unit\ImageStyleTest::setUp()
  3. 11.x core/modules/image/tests/src/Unit/ImageStyleTest.php \Drupal\Tests\image\Unit\ImageStyleTest::setUp()

Overrides UnitTestCase::setUp

File

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

Class

ImageStyleTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21image%21src%21Entity%21ImageStyle.php/class/ImageStyle/9" title="Defines an image style configuration entity." class="local">\Drupal\image\Entity\ImageStyle</a>

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')
        ->willReturn($provider);
    $this->entityTypeManager = $this->createMock('\\Drupal\\Core\\Entity\\EntityTypeManagerInterface');
    $this->entityTypeManager
        ->expects($this->any())
        ->method('getDefinition')
        ->with($this->entityTypeId)
        ->willReturn($this->entityType);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.