camera-picture-slide/test/AppTest/Action/GetLatestCameraPicturesActionTest.php

36 lines
1008 B
PHP
Raw Normal View History

2018-01-15 20:50:40 +01:00
<?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);
}
}