/** * Setup before each test. */ public function setUp() { parent::setUp(); $this->manager = new InstallationManager(Factory::createConfig()); $this->manager->setEventDispatcher(new EventDispatcher()); $this->manager->setFilename($this->fileName); $this->fileName = $this->tmpDir . $this->fileName; }
/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); $this->updateDir = base_path($this->config->getStorage()['update-dir']) . DIRECTORY_SEPARATOR; $this->manager = new UpdateManager(Factory::createConfig()); $this->manager->setEventDispatcher(new EventDispatcher()); $this->manager->setChangeProvider(new GitProvider()); $this->preVerified = FALSE; $this->postVerified = FALSE; $this->filesZipPath = $this->tmpDir . 'test-files.zip'; }
/** * Create new factory instance. * * @return Slicer */ public static function create() { $factory = new static(); if (NULL === Factory::$instance) { Factory::$instance = $factory->createSlicer(); } return Factory::$instance; }
/** * Test create slicer. */ public function testCreateSlicer() { $slicer = Factory::create(); $this->assertNotNull($slicer); $this->assertInstanceOf(Config::class, $slicer->getConfig()); }
/** * Returns the current Slicer instance. * * @param bool|TRUE $required * * @return Slicer */ public function getSlicer($required = TRUE) { if (NULL === $this->slicer) { try { $this->slicer = Factory::create(); } catch (InvalidArgumentException $e) { if ($required && NULL !== $this->output) { $this->output->writeln($e->getMessage()); exit(1); } } } return $this->slicer; }
/** * Get configuration for tests. * * @return Config */ protected function getConfig() { return Factory::createConfig(); }