40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace AppTest\Action;
|
|
|
|
use App\Action\ShowCameraImageAction;
|
|
use App\Action\ShowCameraImageFactory;
|
|
use App\Service\CameraPictureManagerService;
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
class ShowCameraImageFactoryTest 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 ShowCameraImageFactory();
|
|
$this->assertInstanceOf(ShowCameraImageFactory::class, $factory);
|
|
|
|
$showCameraImageAction = $factory($this->container->reveal());
|
|
$this->assertInstanceOf(ShowCameraImageAction::class, $showCameraImageAction);
|
|
}
|
|
}
|