/**
  * @return void
  */
 public function testRollbackDocument()
 {
     $docName = 'somename';
     $this->adapter->expects($this->once())->method('rollbackDocument')->with('pfx_' . $docName);
     $this->config->expects($this->once())->method('getOption')->with('dest_prefix')->will($this->returnValue('pfx_'));
     $this->resourceDestination->rollbackDocument($docName);
 }
예제 #2
0
 /**
  * Rollback backed up documents
  * @return void
  */
 public function rollback()
 {
     foreach (array_keys($this->readerGroups->getGroup('documents')) as $documentName) {
         $destinationDocument = $this->destination->getDocument($this->map->getDocumentMap($documentName, MapInterface::TYPE_SOURCE));
         if ($destinationDocument !== false) {
             $this->destination->rollbackDocument($destinationDocument->getName());
         }
     }
 }