You are here

protected function FocalPointUnitTestCase::setUp in Focal Point 8

Overrides UnitTestCase::setUp

1 call to FocalPointUnitTestCase::setUp()
FocalPointEffectsTest::setUp in tests/src/Unit/Effects/FocalPointEffectsTest.php
1 method overrides FocalPointUnitTestCase::setUp()
FocalPointEffectsTest::setUp in tests/src/Unit/Effects/FocalPointEffectsTest.php

File

tests/src/Unit/FocalPointUnitTestCase.php, line 40

Class

FocalPointUnitTestCase
Focal point unit test case.

Namespace

Drupal\Tests\focal_point\Unit

Code

protected function setUp() {
  parent::setUp();
  $crop_storage = $this
    ->prophesize(CropStorageInterface::class);
  $entity_type_manager = $this
    ->prophesize(EntityTypeManager::class);
  $entity_type_manager
    ->getStorage('crop')
    ->willReturn($crop_storage);
  $this->container = $this
    ->prophesize(ContainerInterface::class);
  $this->container
    ->get('entity_type.manager')
    ->willReturn($entity_type_manager);
  $request = $this
    ->prophesize(Request::class);
  $this->container
    ->get('request')
    ->willReturn($request);
  $this->focalPointManager = new FocalPointManager($entity_type_manager
    ->reveal());
  $this->container
    ->get('focal_point.manager')
    ->willReturn($this->focalPointManager);
  \Drupal::setContainer($this->container
    ->reveal());
}