You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?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;
|
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
|
|
|
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);
|
|
$app->expects($this->exactly(3))
|
|
->method('instance')
|
|
->withConsecutive(
|
|
[Response::class, $response],
|
|
[SymfonyResponse::class, $response],
|
|
['response', $response]
|
|
);
|
|
|
|
$serviceProvider = new ResponseServiceProvider($app);
|
|
$serviceProvider->register();
|
|
}
|
|
}
|