camera-picture-slide/test/AppTest/Service/CameraPictureManagerServiceFactoryTest.php
2018-01-15 23:07:21 +01:00

37 lines
1.1 KiB
PHP

<?php
namespace AppTest\Service;
use App\Service\CameraPictureManagerService;
use App\Service\CameraPictureManagerServiceFactory;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
class CameraPictureManagerServiceFactoryTest extends TestCase
{
/** @var ContainerInterface */
protected $container;
/**
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
protected function setUp()
{
$this->container = $this->prophesize(ContainerInterface::class);
$this->container->get("config")->willReturn(['application' => []]);
}
/**
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function testFactory()
{
$factory = new CameraPictureManagerServiceFactory();
$this->assertInstanceOf(CameraPictureManagerServiceFactory::class, $factory);
$cameraPictureManager = $factory($this->container->reveal());
$this->assertInstanceOf(CameraPictureManagerService::class, $cameraPictureManager);
}
}