Esempio n. 1
0
 public function testDeleteDocumentBackup()
 {
     $docName = 'somename';
     $this->adapter->expects($this->once())->method('deleteBackup')->with('pfx_' . $docName);
     $this->config->expects($this->once())->method('getOption')->with('dest_prefix')->will($this->returnValue('pfx_'));
     $this->resourceDestination->deleteDocumentBackup($docName);
 }
Esempio n. 2
0
 public function testGetRecords()
 {
     $resourceName = 'core_config_data';
     $pageNumber = 2;
     $this->config->expects($this->at(0))->method('getOption')->with('bulk_size')->will($this->returnValue(100));
     $this->config->expects($this->at(1))->method('getOption')->with('dest_prefix')->will($this->returnValue(100));
     $this->adapter->expects($this->once())->method('loadPage');
     $this->resourceDestination->getRecords($resourceName, $pageNumber);
 }
Esempio n. 3
0
 public function testVolumeCheckFailed()
 {
     $this->ratings = new Ratings($this->destination, $this->logger, $this->progress, 'volume');
     $this->progress->expects($this->once())->method('start')->with(1);
     $this->progress->expects($this->once())->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $this->destination->expects($this->once())->method('getAdapter')->willReturn($this->adapter);
     $this->adapter->expects($this->exactly(2))->method('getSelect')->willReturn($this->select);
     $this->select->expects($this->at(0))->method('from')->with('rating_store', ['rating_id'])->will($this->returnSelf());
     $this->select->expects($this->at(1))->method('where')->with('store_id > 0')->will($this->returnSelf());
     $this->adapter->expects($this->at(1))->method('loadDataFromSelect')->with($this->select)->willReturn([['rating_id' => 1]]);
     $this->adapter->expects($this->at(3))->method('loadDataFromSelect')->with($this->select)->willReturn([['rating_id' => 2]]);
     $this->select->expects($this->at(2))->method('from')->with('rating', ['rating_id'])->will($this->returnSelf());
     $this->select->expects($this->at(3))->method('where')->with('is_active = ?', 1)->will($this->returnSelf());
     $this->logger->expects($this->once())->method('warning')->with('Mismatch of entities in the documents: rating, rating_store');
     $this->assertFalse($this->ratings->perform());
 }
 public function testGetDeletedRecords()
 {
     $this->adapter->expects($this->once())->method('loadDeletedRecords')->with('m2_cl_document', 'key_field', 0, 100);
     $this->resourceSource->getDeletedRecords('document', 'key_field');
 }
Esempio n. 5
0
 public function testGetDeletedRecords()
 {
     $this->adapter->expects($this->once())->method('loadDeletedRecords')->with('m2_cl_document', 'key_field', 0, 100);
     $this->config->expects($this->any())->method('getOption')->willReturnMap([['source_prefix', ''], ['bulk_size', 100]]);
     $this->resourceSource->getDeletedRecords('document', 'key_field');
 }