public function testSetCreateStructure()
 {
     $timeTaken = 11;
     $memoryUsage = 22;
     $memoryUsed = 33;
     $options = array('my' => 'option');
     $this->entity->setCreateStructure($timeTaken, $memoryUsage, $memoryUsed, $options);
     $result = $this->entity->toArray();
     $this->assertArrayHasKey(JobStats::NAME_CREATE_STRUCTURE, $result['data']);
     $data = $result['data'][JobStats::NAME_CREATE_STRUCTURE];
     $this->assertSame($timeTaken, $data['timeTaken']);
     $this->assertSame($memoryUsage, $data['memoryUsage']);
     $this->assertSame($memoryUsed, $data['memoryUsed']);
     $this->assertEquals($options, $data['options']);
     $this->assertContains(date('Y-m-d H:i:'), $data['createdAt']);
 }
 /**
  * Create folder structure for a job
  *
  * @param BackupJob $job
  * @param JobStats $jobStats
  * @param OutputInterface $output
  * @author Daniel Wendlandt
  */
 private function createStructure(BackupJob $job, JobStats $jobStats, OutputInterface $output)
 {
     $memoryAtSection = memory_get_usage();
     $timeStartSection = microtime(true);
     $this->filesystem->createStructure($job->getPath());
     $jobStats->setCreateStructure(microtime(true) - $timeStartSection, memory_get_usage(), memory_get_usage() - $memoryAtSection);
     $output->writeln('<info>*** Created folder structure ***</info>' . PHP_EOL);
 }