function PsrResponseSubscriberTest::setUp

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\PsrResponseSubscriberTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\PsrResponseSubscriberTest::setUp()
  3. 10 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 37

Class

PsrResponseSubscriberTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21EventSubscriber%21PsrResponseSubscriber.php/class/PsrResponseSubscriber/11.x" title="Response subscriber for handling PSR-7 responses." class="local">\Drupal\Core\EventSubscriber\PsrResponseSubscriber</a> @group EventSubscriber

Namespace

Drupal\Tests\Core\EventSubscriber

Code

protected function setUp() : void {
    parent::setUp();
    $factory = $this->getMockBuilder('Symfony\\Bridge\\PsrHttpMessage\\HttpFoundationFactoryInterface')
        ->disableOriginalConstructor()
        ->getMock();
    $factory->expects($this->any())
        ->method('createResponse')
        ->willReturn($this->createMock('Symfony\\Component\\HttpFoundation\\Response'));
    $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.