С версии: 1.0
Автор: Bernhard Schussek (bschussek@gmail.com)
Наследование: implements Puli\Manager\Api\Factory\FactoryManager
Пример #1
0
 public function testCreateFactoryWithExistingAutoLoadableClass()
 {
     $this->assertFalse(class_exists('Puli\\Manager\\Tests\\Factory\\Fixtures\\TestFactory', false));
     $this->context->getConfig()->set(Config::FACTORY_IN_FILE, null);
     $this->context->getConfig()->set(Config::FACTORY_IN_CLASS, 'Puli\\Manager\\Tests\\Factory\\Fixtures\\TestFactory');
     $factory = $this->manager->createFactory();
     $this->assertInstanceOf('Puli\\Manager\\Tests\\Factory\\Fixtures\\TestFactory', $factory);
 }
 public function testCreateFactoryWithCustomParameters()
 {
     $this->assertFalse(class_exists('Puli\\Repository\\Tests\\TestGeneratedFactory2', false));
     $factory = $this->manager->createFactory('MyFactory.php', 'Puli\\Repository\\Tests\\TestGeneratedFactory2');
     $this->isInstanceOf('Puli\\Repository\\Tests\\TestGeneratedFactory2', $factory);
 }