You are here

protected function EmitControllerTest::setUp in Radioactivity 8.3

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/EmitControllerTest.php \Drupal\Tests\radioactivity\Unit\EmitControllerTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/EmitControllerTest.php, line 53

Class

EmitControllerTest
@coversDefaultClass \Drupal\radioactivity\Controller\EmitController @group radioactivity

Namespace

Drupal\Tests\radioactivity\Unit

Code

protected function setUp() : void {
  parent::setUp();

  // Initiate the Settings singleton used by this test.
  new Settings([
    'hash_salt' => 'liesjeleerdelotjelopen',
  ]);
  $this->request = $this
    ->prophesize(Request::class);
  $this->incidentStorageFactory = $this
    ->prophesize(StorageFactory::class);
  $this->defaultIncidentStorage = $this
    ->prophesize(IncidentStorageInterface::class);
  $this->incidentStorageFactory
    ->get('default')
    ->willReturn($this->defaultIncidentStorage
    ->reveal());
  $this->container = $this
    ->prophesize(ContainerInterface::class);
  \Drupal::setContainer($this->container
    ->reveal());
  $this->container
    ->get('radioactivity.storage')
    ->willReturn($this->incidentStorageFactory
    ->reveal());
}