Exemplo n.º 1
0
 /**
  * @covers de\detert\sebastian\slimline\Factory::create
  */
 public function testShouldCreateNewClassWithEachCall()
 {
     $factory = new Factory();
     /** @var $dummy \de\detert\sebastian\slimline\Tests\Helper\Dummy */
     $dummy = $factory->create('\\de\\detert\\sebastian\\slimline\\Tests\\Helper\\Dummy', new Pool());
     $dummy2 = $factory->create('\\de\\detert\\sebastian\\slimline\\Tests\\Helper\\Dummy', new Pool());
     $this->assertFalse($dummy === $dummy2, "factory should create new instances with each call");
 }
Exemplo n.º 2
0
 /**
  * @param Config $config
  * @param Factory $factory
  */
 public function __construct(Config $config, Factory $factory)
 {
     $config->includes['de\\detert\\sebastian\\slimline'] = realpath(__DIR__);
     $this->pool = $factory->create('de\\detert\\sebastian\\slimline\\Pool');
     $this->pool->config = $config;
     $this->pool->factory = $factory;
     spl_autoload_register(array($this, 'simpleAutoload'));
     date_default_timezone_set($config->timezone);
     $this->setHandlers();
     $this->setRequest();
     $this->pool->config->init($this->pool);
 }