protected function ResponsiveImageStyleConfigEntityUnitTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php \Drupal\Tests\responsive_image\Unit\ResponsiveImageStyleConfigEntityUnitTest::setUp()
- 9 core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php \Drupal\Tests\responsive_image\Unit\ResponsiveImageStyleConfigEntityUnitTest::setUp()
File
- core/
modules/ responsive_image/ tests/ src/ Unit/ ResponsiveImageStyleConfigEntityUnitTest.php, line 41
Class
- ResponsiveImageStyleConfigEntityUnitTest
- @coversDefaultClass \Drupal\responsive_image\Entity\ResponsiveImageStyle @group block
Namespace
Drupal\Tests\responsive_image\UnitCode
protected function setUp() : void {
$this->entityType = $this
->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
$this->entityType
->expects($this
->any())
->method('getProvider')
->will($this
->returnValue('responsive_image'));
$this->entityTypeManager = $this
->createMock(EntityTypeManagerInterface::class);
$this->entityTypeManager
->expects($this
->any())
->method('getDefinition')
->with('responsive_image_style')
->will($this
->returnValue($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);
}