/** * Execute the backup. * * @param \phpbu\App\Configuration\Backup $conf * @param \phpbu\App\Backup\Target $target * @throws \Exception */ protected function executeSource(Configuration\Backup $conf, Target $target) { $this->result->backupStart($conf); $source = $this->factory->createSource($conf->getSource()->type, $conf->getSource()->options); $runner = $this->factory->createRunner('source'); $runner->run($source, $target, $this->result); $this->result->backupEnd($conf); }
/** * Execute the backup. * * @param \phpbu\App\Configuration\Backup $conf * @param \phpbu\App\Backup\Target $target * @throws \Exception */ protected function executeSource(Configuration\Backup $conf, Target $target) { $this->result->backupStart($conf); /* @var \phpbu\App\Runner\Source $runner */ $source = $this->factory->createSource($conf->getSource()->type, $conf->getSource()->options); $runner = $this->factory->createRunner('source'); $runner->run($source, $target, $this->result, $this->configuration->isSimulation()); $this->result->backupEnd($conf); }
/** * Tests Factory::createSource * * @expectedException \phpbu\App\Exception */ public function testCreateSourceThatIsNone() { Factory::register('source', 'nothing', '\\phpbu\\App\\phpbuAppFactoryTestNothing', true); $factory = new Factory(); $factory->createSource('nothing'); $this->assertFalse(true, 'Exception should be thrown'); }