Пример #1
0
 /**
  * @test
  */
 public function updates_current_import_status()
 {
     $import = $this->getMock(Import::class);
     $import->expects($this->once())->method('getFilepath')->will($this->returnValue('./import.csv'));
     $import->expects($this->once())->method('getPointer')->will($this->returnValue(1));
     $import->expects($this->exactly(2))->method('getAmount')->will($this->returnValue(2));
     $this->service->expects($this->exactly(3))->method('updateImport')->withConsecutive([$import], [$import, 2], [$import, 2]);
     $resource = $this->getMock(ResourceInterface::class);
     $resource->expects($this->once())->method('getFilepathExpression')->will($this->returnValue('/\\.csv$/'));
     $manager = $this->getMock(ManagerInterface::class);
     $manager->expects($this->any())->method('getUpdateInterval')->will($this->returnValue(2));
     $target = $this->getMock(TargetInterface::class);
     $result = $this->fixture->process($import, [$target], [], $resource, $manager);
 }