/** * @BeforeScenario */ public function before(BeforeScenarioScope $scope) { $this->result = null; $this->engine = new Engine(new FilesystemRepository(sys_get_temp_dir()), new Connection('dbname=phn_test user=postgres'), __DIR__ . '/../../var', true); $this->engine->addExtension(new CoreExtension()); $this->engine->build(); $this->filesystem = new Filesystem(); }
/** * Constructor. * * @param string $dsn * @param array $options */ public function __construct($dsn, array $options = []) { $resolver = new OptionsResolver(); $this->configureOptions($resolver); $options = $resolver->resolve($options); $this->connection = new Connection($dsn); $this->engine = new Engine($options['puli_repository'], $this->connection, $options['cache_dir'], $options['is_debug']); foreach ($options['puli_discovery']->findBindings(ExtensionInterface::class) as $binding) { $class = $binding->getClassName(); $this->engine->addExtension(new $class()); } $this->engine->build(); }