function ResponsiveImageStyleConfigEntityUnitTest::setUp

Same name in other branches
  1. 9 core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php \Drupal\Tests\responsive_image\Unit\ResponsiveImageStyleConfigEntityUnitTest::setUp()
  2. 8.9.x core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php \Drupal\Tests\responsive_image\Unit\ResponsiveImageStyleConfigEntityUnitTest::setUp()
  3. 11.x core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php \Drupal\Tests\responsive_image\Unit\ResponsiveImageStyleConfigEntityUnitTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php, line 43

Class

ResponsiveImageStyleConfigEntityUnitTest
@coversDefaultClass \Drupal\responsive_image\Entity\ResponsiveImageStyle @group block

Namespace

Drupal\Tests\responsive_image\Unit

Code

protected function setUp() : void {
    parent::setUp();
    $this->entityType = $this->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
    $this->entityType
        ->expects($this->any())
        ->method('getProvider')
        ->willReturn('responsive_image');
    $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $this->entityTypeManager
        ->expects($this->any())
        ->method('getDefinition')
        ->with('responsive_image_style')
        ->willReturn($this->entityType);
    $this->breakpointManager = $this->createMock('\\Drupal\\breakpoint\\BreakpointManagerInterface');
    $container = new ContainerBuilder();
    $container->set('entity_type.manager', $this->entityTypeManager);
    $container->set('breakpoint.manager', $this->breakpointManager);
    \Drupal::setContainer($container);
}

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