diff -u b/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php b/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php --- b/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php +++ b/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php @@ -12,8 +12,7 @@ use Drupal\user\UserInterface; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\Response; -use Zend\Diactoros\Response as PSRResponse; -use Zend\Diactoros\Stream; +use Zend\Diactoros\Response\HtmlResponse; /** @@ -106,10 +105,7 @@ } public function test23() { - $stream = new Stream('php://memory', 'wb+'); - $stream->write('test23'); - $response = new PSRResponse($stream); - return $response; + return new HtmlResponse('test23'); } /** diff -u b/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php --- b/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php @@ -47,7 +47,10 @@ */ public function testConvertsControllerResult() { $event = $this->createEventMock($this->getMock('Psr\Http\Message\ResponseInterface')); - $event->expects($this->once())->method('setResponse')->with($this->isInstanceOf('Symfony\Component\HttpFoundation\Response')); + $event + ->expects($this->once()) + ->method('setResponse') + ->with($this->isInstanceOf('Symfony\Component\HttpFoundation\Response')); $this->psrResponseSubscriber->onKernelView($event); } @@ -58,11 +61,15 @@ * @covers ::onKernelView */ public function testDoesNotConvertControllerResult() { - $event = $this->createEventMock(array()); - $event->expects($this->never())->method('setResponse'); + $event = $this->createEventMock([]); + $event + ->expects($this->never()) + ->method('setResponse'); $this->psrResponseSubscriber->onKernelView($event); $event = $this->createEventMock(NULL); - $event->expects($this->never())->method('setResponse'); + $event + ->expects($this->never()) + ->method('setResponse'); $this->psrResponseSubscriber->onKernelView($event); } @@ -76,11 +83,11 @@ * A mock object to test. */ protected function createEventMock($controller_result) { - $event = $this->getMock('Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent', array(), array(), '', NULL); + $event = $this->getMock('Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent', [], [], '', NULL); $event - ->expects($this->any()) - ->method('getControllerResult') - ->will($this->returnValue($controller_result)); + ->expects($this->any()) + ->method('getControllerResult') + ->will($this->returnValue($controller_result)); return $event; } @@ -91,11 +98,11 @@ * A mock object to test. */ protected function createFactoryMock() { - $factory = $this->getMock('Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface', array(), array(), '', NULL); + $factory = $this->getMock('Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface', [], [], '', NULL); $factory - ->expects($this->any()) - ->method('createResponse') - ->will($this->returnValue($this->getMock('Symfony\Component\HttpFoundation\Response'))); + ->expects($this->any()) + ->method('createResponse') + ->will($this->returnValue($this->getMock('Symfony\Component\HttpFoundation\Response'))); return $factory; }