40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace AppTest\Action;
|
||
|
|
|
||
|
|
use App\Action\GetLatestCameraPicturesAction;
|
||
|
|
use App\Action\GetLatestCameraPicturesFactory;
|
||
|
|
use App\Service\CameraPictureManagerService;
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
use Psr\Container\ContainerInterface;
|
||
|
|
|
||
|
|
class GetLatestCameraPicturesFactoryTest extends TestCase
|
||
|
|
{
|
||
|
|
/** @var ContainerInterface */
|
||
|
|
protected $container;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @throws \Psr\Container\ContainerExceptionInterface
|
||
|
|
* @throws \Psr\Container\NotFoundExceptionInterface
|
||
|
|
*/
|
||
|
|
protected function setUp()
|
||
|
|
{
|
||
|
|
$this->container = $this->prophesize(ContainerInterface::class);
|
||
|
|
$cameraPictureManager = $this->prophesize(CameraPictureManagerService::class);
|
||
|
|
$this->container->get(CameraPictureManagerService::class)->willReturn($cameraPictureManager);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @throws \Psr\Container\ContainerExceptionInterface
|
||
|
|
* @throws \Psr\Container\NotFoundExceptionInterface
|
||
|
|
*/
|
||
|
|
public function testFactory()
|
||
|
|
{
|
||
|
|
$factory = new GetLatestCameraPicturesFactory();
|
||
|
|
$this->assertInstanceOf(GetLatestCameraPicturesFactory::class, $factory);
|
||
|
|
|
||
|
|
$getLatestCameraPicturesAction = $factory($this->container->reveal());
|
||
|
|
$this->assertInstanceOf(GetLatestCameraPicturesAction::class, $getLatestCameraPicturesAction);
|
||
|
|
}
|
||
|
|
}
|