Created specific factory for AppOptions to prevent circular dependency with cache

This commit is contained in:
Alejandro Celaya
2016-08-15 23:40:49 +02:00
parent ffa6c0d2ca
commit 5ca4bc928d
6 changed files with 77 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace ShlinkioTest\Shlink\Core\Options;
use PHPUnit_Framework_TestCase as TestCase;
use Shlinkio\Shlink\Core\Options\AppOptions;
use Shlinkio\Shlink\Core\Options\AppOptionsFactory;
use Zend\ServiceManager\ServiceManager;
class AppOptionsFactoryTest extends TestCase
{
/**
* @var AppOptionsFactory
*/
protected $factory;
public function setUp()
{
$this->factory = new AppOptionsFactory();
}
/**
* @test
*/
public function serviceIsCreated()
{
$instance = $this->factory->__invoke(new ServiceManager([]), '');
$this->assertInstanceOf(AppOptions::class, $instance);
}
}