39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace AppTest\Action;
|
|
|
|
use App\Action\GetLatestCameraPicturesAction;
|
|
use App\Service\CameraPictureManagerService;
|
|
use Interop\Http\ServerMiddleware\DelegateInterface;
|
|
use PHPUnit\Framework\TestCase;
|
|
use Prophecy\Argument;
|
|
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);
|
|
// $this->cameraPictureManager->getLatestCameraPictures()
|
|
// ->willReturn([]);
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|