engelsystem/tests/Unit/Http/ResponseServiceProviderTest...

39 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
namespace Engelsystem\Test\Unit\Http;
use Engelsystem\Http\Response;
use Engelsystem\Http\ResponseServiceProvider;
use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit\Framework\MockObject\MockObject;
2018-09-02 02:09:56 +02:00
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
class ResponseServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Http\ResponseServiceProvider::register()
*/
public function testRegister(): void
{
/** @var Response|MockObject $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]
);
$serviceProvider = new ResponseServiceProvider($app);
$serviceProvider->register();
}
}