2018-01-15 20:50:40 +01:00
|
|
|
<?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);
|
2018-01-15 23:07:21 +01:00
|
|
|
$this->container->get("config")->willReturn(['application' => []]);
|
2018-01-15 20:50:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @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);
|
|
|
|
|
}
|
|
|
|
|
}
|