Exemplo n.º 1
0
 /**
  * Test getExecutionTime()
  */
 public function testGetExecutionTime()
 {
     $time = '01:02:03';
     $this->timezone->expects($this->any())->method('date')->willReturnSelf();
     $this->timezone->expects($this->any())->method('getConfigTimezone')->willReturn('America/Los_Angeles');
     $this->timezone->expects($this->any())->method('diff')->willReturnSelf();
     $this->timezone->expects($this->any())->method('format')->willReturn($time);
     $this->assertEquals($time, $this->report->getExecutionTime($time));
 }
Exemplo n.º 2
0
 /**
  * Update import history report
  *
  * @param Import $import
  * @param bool $updateSummary
  * @return $this
  */
 public function updateReport(Import $import, $updateSummary = false)
 {
     if ($import->isReportEntityType()) {
         $this->load($this->getLastItemId());
         $executionResult = self::IMPORT_IN_PROCESS;
         if ($updateSummary) {
             $executionResult = $this->reportHelper->getExecutionTime($this->getStartedAt());
             $summary = $this->reportHelper->getSummaryStats($import);
             $this->setSummary($summary);
         }
         $this->setExecutionTime($executionResult);
         $this->save();
     }
     return $this;
 }