/**
  * 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;
 }
Beispiel #2
0
 /**
  * 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';
 }
Beispiel #3
0
 /**
  * Create new factory instance.
  *
  * @return Slicer
  */
 public static function create()
 {
     $factory = new static();
     if (NULL === Factory::$instance) {
         Factory::$instance = $factory->createSlicer();
     }
     return Factory::$instance;
 }
Beispiel #4
0
 /**
  * Test create slicer.
  */
 public function testCreateSlicer()
 {
     $slicer = Factory::create();
     $this->assertNotNull($slicer);
     $this->assertInstanceOf(Config::class, $slicer->getConfig());
 }
Beispiel #5
0
 /**
  * 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;
 }
Beispiel #6
0
 /**
  * Get configuration for tests.
  *
  * @return Config
  */
 protected function getConfig()
 {
     return Factory::createConfig();
 }