You are here

public function ImageStyleTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 93
Contains \Drupal\Tests\image\Unit\ImageStyleTest.

Class

ImageStyleTest
@coversDefaultClass \Drupal\image\Entity\ImageStyle

Namespace

Drupal\Tests\image\Unit

Code

public function setUp() {
  $this->entityTypeId = $this
    ->randomMachineName();
  $this->provider = $this
    ->randomMachineName();
  $this->entityType = $this
    ->getMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
  $this->entityType
    ->expects($this
    ->any())
    ->method('getProvider')
    ->will($this
    ->returnValue($this->provider));
  $this->entityManager = $this
    ->getMock('\\Drupal\\Core\\Entity\\EntityManagerInterface');
  $this->entityManager
    ->expects($this
    ->any())
    ->method('getDefinition')
    ->with($this->entityTypeId)
    ->will($this
    ->returnValue($this->entityType));
}