/** * Execute checks. * * @param \phpbu\App\Configuration\Backup $backup * @param \phpbu\App\Backup\Target $target * @param \phpbu\App\Backup\Collector $collector * @throws \Exception */ protected function executeChecks(Configuration\Backup $backup, Target $target, Collector $collector) { $runner = $this->factory->createRunner('check'); /** @var \phpbu\App\Configuration\Backup\Check $check */ foreach ($backup->getChecks() as $config) { $check = $this->factory->createCheck($config->type); $runner->run($check, $config, $target, $collector, $this->result); } $this->failure = $runner->hasFailed(); }
/** * Tests Factory::createCleaner * * @expectedException \phpbu\App\Exception */ public function testCreateCheckThatIsNone() { Factory::register('check', 'nothing', '\\phpbu\\App\\phpbuAppFactoryTestNothing', true); $factory = new Factory(); $factory->createCheck('nothing'); $this->assertFalse(true, 'Exception should be thrown'); }