Do not use ServerRequestFactory::fromGlobals in tests

This commit is contained in:
Alejandro Celaya
2018-12-25 23:01:30 +01:00
parent 8b3324e143
commit 32070b1fa7
30 changed files with 126 additions and 140 deletions

View File

@@ -9,7 +9,7 @@ use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Core\Response\NotFoundHandler;
use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequestFactory;
use Zend\Diactoros\ServerRequest;
use Zend\Expressive\Template\TemplateRendererInterface;
class NotFoundHandlerTest extends TestCase
@@ -35,7 +35,7 @@ class NotFoundHandlerTest extends TestCase
*/
public function properResponseTypeIsReturned(string $expectedResponse, string $accept, int $renderCalls)
{
$request = ServerRequestFactory::fromGlobals()->withHeader('Accept', $accept);
$request = (new ServerRequest())->withHeader('Accept', $accept);
/** @var MethodProphecy $render */
$render = $this->renderer->render(Argument::cetera())->willReturn('');