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