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

40 lines
1.3 KiB
PHP
Raw Normal View History

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