* initial commit
This commit is contained in:
38
test/AppTest/Action/GetLatestCameraPicturesActionTest.php
Normal file
38
test/AppTest/Action/GetLatestCameraPicturesActionTest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user