Esempio n. 1
0
 /**
  * Test create config.
  */
 public function testCreateConfig()
 {
     $config = Factory::createConfig();
     $this->assertInstanceOf(Config::class, $config);
     $this->assertEquals('slicer/slicer', $config->getAppName());
     $this->assertEquals(clean_slicer_path(__DIR__ . '/../../../'), $config->getBaseDir());
 }
Esempio n. 2
0
 /**
  * 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;
 }
Esempio n. 3
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';
 }
Esempio n. 4
0
 /**
  * Create a Slicer instance.
  *
  * @return Slicer
  */
 public function createSlicer()
 {
     $config = Factory::createConfig();
     $slicer = new Slicer();
     $slicer->setConfig($config);
     $slicer->setEventDispatcher(new EventDispatcher());
     $slicer->setEventDispatcher($slicer->getEventDispatcher());
     $slicer->setUpdateManager(new UpdateManager($config));
     $slicer->setDownloadManager(new DownloadManager($config));
     $slicer->setBackupManager(new BackupManager($config));
     $slicer->setInstallationManager(new InstallationManager($config));
     $slicer->getUpdateManager()->setDownloadManager($slicer->getDownloadManager())->setEventDispatcher($slicer->getEventDispatcher());
     $slicer->getDownloadManager()->setEventDispatcher($slicer->getEventDispatcher());
     $slicer->getBackupManager()->setEventDispatcher($slicer->getEventDispatcher());
     $slicer->getInstallationManager()->setEventDispatcher($slicer->getEventDispatcher());
     return $slicer;
 }
Esempio n. 5
0
 /**
  * Get configuration for tests.
  *
  * @return Config
  */
 protected function getConfig()
 {
     return Factory::createConfig();
 }