Пример #1
0
 /**
  * Cover createHistoryReport().
  */
 public function testCreateHistoryReportExtensionIsSet()
 {
     $sourceFileRelative = 'not array';
     $entity = 'entity value';
     $extension = 'extension value';
     $result = [];
     $fileName = $entity . $extension;
     $gmtTimestamp = 1234567;
     $copyName = $gmtTimestamp . '_' . $fileName;
     $this->import->expects($this->once())->method('isReportEntityType')->with($entity)->willReturn(true);
     $this->_varDirectory->expects($this->never())->method('getRelativePath');
     $this->dateTime->expects($this->once())->method('gmtTimestamp')->willReturn($gmtTimestamp);
     $this->historyModel->expects($this->once())->method('addReport')->with($copyName);
     $args = [$sourceFileRelative, $entity, $extension, $result];
     $actualResult = $this->invokeMethod($this->import, 'createHistoryReport', $args);
     $this->assertEquals($this->import, $actualResult);
 }