/** * @return bool */ public function perform() { $this->progress->start(count($this->groups->getGroup('documents'))); $this->validateAttributes(); $this->validateAttributeSetsAndGroups(); $this->progress->finish(); $result = $this->checkForErrors(Logger::ERROR); if ($result) { $this->helper->deleteBackups(); } return $result; }
/** * @return void */ public function testDeleteBackups() { $this->readerGroups->expects($this->once())->method('getGroup')->with('documents')->willReturn(['some_document' => 0]); $this->map->expects($this->once())->method('getDocumentMap')->with('some_document', MapInterface::TYPE_SOURCE)->will($this->returnValue('some_dest_document')); $this->destination->expects($this->once())->method('deleteDocumentBackup')->with('some_dest_document'); $this->helper->deleteBackups(); }