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;
|
|
|
|
use PHPUnit_Framework_MockObject_MockObject as 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()
|
|
|
|
{
|
|
|
|
/** @var MockObject|Response $response */
|
|
|
|
$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();
|
|
|
|
}
|
|
|
|
}
|