36 lines
1008 B
PHP
36 lines
1008 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace AppTest\Action;
|
||
|
|
|
||
|
|
use App\Action\GetLatestCameraPicturesAction;
|
||
|
|
use App\Service\CameraPictureManagerService;
|
||
|
|
use Interop\Http\ServerMiddleware\DelegateInterface;
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
use Psr\Http\Message\ServerRequestInterface;
|
||
|
|
use Zend\Diactoros\Response\JsonResponse;
|
||
|
|
|
||
|
|
class GetLatestCameraPicturesActionTest extends TestCase
|
||
|
|
{
|
||
|
|
/** @var CameraPictureManagerService */
|
||
|
|
protected $cameraPictureManager;
|
||
|
|
|
||
|
|
protected function setUp()
|
||
|
|
{
|
||
|
|
$this->cameraPictureManager = $this->prophesize(CameraPictureManagerService::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function testReturnsJsonResponse()
|
||
|
|
{
|
||
|
|
$homePage = new GetLatestCameraPicturesAction(
|
||
|
|
$this->cameraPictureManager->reveal()
|
||
|
|
);
|
||
|
|
|
||
|
|
$response = $homePage->process(
|
||
|
|
$this->prophesize(ServerRequestInterface::class)->reveal(),
|
||
|
|
$this->prophesize(DelegateInterface::class)->reveal()
|
||
|
|
);
|
||
|
|
|
||
|
|
$this->assertInstanceOf(JsonResponse::class, $response);
|
||
|
|
}
|
||
|
|
}
|