2018-01-18 19:01:34 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Test\Unit\Http;
|
|
|
|
|
|
|
|
use Engelsystem\Http\Response;
|
|
|
|
use Engelsystem\Http\ResponseServiceProvider;
|
|
|
|
use Engelsystem\Test\Unit\ServiceProviderTest;
|
2019-04-24 10:45:00 +02:00
|
|
|
use PHPUnit\Framework\MockObject\MockObject;
|
2018-09-02 02:09:56 +02:00
|
|
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
2018-01-18 19:01:34 +01:00
|
|
|
|
|
|
|
class ResponseServiceProviderTest extends ServiceProviderTest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Http\ResponseServiceProvider::register()
|
|
|
|
*/
|
|
|
|
public function testRegister(): void
|
|
|
|
{
|
2019-04-24 10:45:00 +02:00
|
|
|
/** @var Response|MockObject $response */
|
2018-01-18 19:01:34 +01:00
|
|
|
$response = $this->getMockBuilder(Response::class)
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$app = $this->getApp();
|
|
|
|
|
|
|
|
$this->setExpects($app, 'make', [Response::class], $response);
|
2018-09-02 02:09:56 +02:00
|
|
|
$app->expects($this->exactly(3))
|
|
|
|
->method('instance')
|
|
|
|
->withConsecutive(
|
|
|
|
[Response::class, $response],
|
|
|
|
[SymfonyResponse::class, $response],
|
|
|
|
['response', $response]
|
|
|
|
);
|
2018-01-18 19:01:34 +01:00
|
|
|
|
|
|
|
$serviceProvider = new ResponseServiceProvider($app);
|
|
|
|
$serviceProvider->register();
|
|
|
|
}
|
|
|
|
}
|