function PsrResponseSubscriberTest::setUp

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\PsrResponseSubscriberTest::setUp()
  2. 10 core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\PsrResponseSubscriberTest::setUp()
  3. 9 core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\PsrResponseSubscriberTest::setUp()
  4. 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\PsrResponseSubscriberTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php, line 42

Class

PsrResponseSubscriberTest
Tests Drupal\Core\EventSubscriber\PsrResponseSubscriber.

Namespace

Drupal\Tests\Core\EventSubscriber

Code

protected function setUp() : void {
  parent::setUp();
  $factory = $this->createStub(HttpFoundationFactoryInterface::class);
  $factory->method('createResponse')
    ->willReturn($this->createStub(Response::class));
  $this->httpFoundationFactoryMock = $factory;
  $this->psrResponseSubscriber = new PsrResponseSubscriber($this->httpFoundationFactoryMock);
}

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