summaryrefslogtreecommitdiff
path: root/tests/Unit/Http
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-23 19:13:19 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-23 20:11:37 +0200
commit66038eda14d5d4e624b6636a6156570e3e940e49 (patch)
tree6e4b7557b7d91786ef47f22f7ddef85eed1dfb42 /tests/Unit/Http
parent590adffa9316b98544cb8d67b03b80e44ba9c8b7 (diff)
parent9d34f371cb9c5ab0d60bd3158678b9cc9da6cc80 (diff)
Merge branch 'twig-templates'
Diffstat (limited to 'tests/Unit/Http')
-rw-r--r--tests/Unit/Http/RequestServiceProviderTest.php10
-rw-r--r--tests/Unit/Http/ResponseServiceProviderTest.php9
2 files changed, 17 insertions, 2 deletions
diff --git a/tests/Unit/Http/RequestServiceProviderTest.php b/tests/Unit/Http/RequestServiceProviderTest.php
index eddf7ee5..4e9bb4e0 100644
--- a/tests/Unit/Http/RequestServiceProviderTest.php
+++ b/tests/Unit/Http/RequestServiceProviderTest.php
@@ -8,6 +8,7 @@ use Engelsystem\Http\Request;
use Engelsystem\Http\RequestServiceProvider;
use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
+use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
class RequestServiceProviderTest extends ServiceProviderTest
{
@@ -45,9 +46,16 @@ class RequestServiceProviderTest extends ServiceProviderTest
$this->setExpects($app, 'call', [[Request::class, 'createFromGlobals']], $request);
$this->setExpects($app, 'get', ['config'], $config);
- $this->setExpects($app, 'instance', ['request', $request]);
$this->setExpects($config, 'get', ['trusted_proxies'], $configuredProxies);
+ $app->expects($this->exactly(3))
+ ->method('instance')
+ ->withConsecutive(
+ [Request::class, $request],
+ [SymfonyRequest::class, $request],
+ ['request', $request]
+ );
+
/** @var ServiceProvider|MockObject $serviceProvider */
$serviceProvider = $this->getMockBuilder(RequestServiceProvider::class)
->setConstructorArgs([$app])
diff --git a/tests/Unit/Http/ResponseServiceProviderTest.php b/tests/Unit/Http/ResponseServiceProviderTest.php
index 52e95714..6ce1f4fe 100644
--- a/tests/Unit/Http/ResponseServiceProviderTest.php
+++ b/tests/Unit/Http/ResponseServiceProviderTest.php
@@ -6,6 +6,7 @@ use Engelsystem\Http\Response;
use Engelsystem\Http\ResponseServiceProvider;
use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
+use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
class ResponseServiceProviderTest extends ServiceProviderTest
{
@@ -21,7 +22,13 @@ class ResponseServiceProviderTest extends ServiceProviderTest
$app = $this->getApp();
$this->setExpects($app, 'make', [Response::class], $response);
- $this->setExpects($app, 'instance', ['response', $response]);
+ $app->expects($this->exactly(3))
+ ->method('instance')
+ ->withConsecutive(
+ [Response::class, $response],
+ [SymfonyResponse::class, $response],
+ ['response', $response]
+ );
$serviceProvider = new ResponseServiceProvider($app);
$serviceProvider->register();