/** * @param StageInterface $object * @param string $step * @param string $stage * @return bool */ protected function runStage($object, $step, $stage) { $this->logger->info('started', ['step' => $step, 'stage' => $stage, 'mode' => $this->mode]); if ($this->progress->isCompleted($object, $stage)) { return true; } try { $result = $object->perform(); } catch (\Migration\Exception $e) { $this->logger->error($e->getMessage()); return false; } if ($result && $this->canBeCompleted) { $this->progress->saveResult($object, $stage, $result); } return $result; }
/** * @param array $data * @param mixed $step * @param string $stage * @param bool $result * @dataProvider isCompletedDataProvider * @return void */ public function testIsCompleted($data, $step, $stage, $result) { $this->file->expects($this->once())->method('getData')->will($this->returnValue($data)); $isCompleted = $this->progress->isCompleted($step, $stage); $this->assertEquals($result, $isCompleted); }