shlink/module/Common/test/Factory/EntityManagerFactoryTest.php

41 lines
960 B
PHP
Raw Normal View History

2016-04-17 21:27:24 +03:00
<?php
2017-10-12 11:13:20 +03:00
declare(strict_types=1);
2016-07-19 18:38:41 +03:00
namespace ShlinkioTest\Shlink\Common\Factory;
2016-04-17 21:27:24 +03:00
use Doctrine\ORM\EntityManager;
2017-03-24 22:34:18 +03:00
use PHPUnit\Framework\TestCase;
2016-07-19 18:38:41 +03:00
use Shlinkio\Shlink\Common\Factory\EntityManagerFactory;
2016-04-17 21:27:24 +03:00
use Zend\ServiceManager\ServiceManager;
class EntityManagerFactoryTest extends TestCase
{
/** @var EntityManagerFactory */
private $factory;
2016-04-17 21:27:24 +03:00
public function setUp()
{
$this->factory = new EntityManagerFactory();
}
/**
* @test
*/
public function serviceIsCreated()
{
$sm = new ServiceManager(['services' => [
'config' => [
'debug' => true,
'entity_manager' => [
'connection' => [
'driver' => 'pdo_sqlite',
],
2016-04-17 21:27:24 +03:00
],
],
]]);
$em = $this->factory->__invoke($sm, EntityManager::class);
$this->assertInstanceOf(EntityManager::class, $em);
}
}