public function testCreateStructure() { $path = '/tmp/test-path'; $structureArray = [$path . DIRECTORY_SEPARATOR . FilesystemRepositoryInterface::DIR_META, $path . DIRECTORY_SEPARATOR . FilesystemRepositoryInterface::DIR_SCHEMA, $path . DIRECTORY_SEPARATOR . FilesystemRepositoryInterface::DIR_DATA]; $this->filesystem->expects($this->once())->method('mkdir')->with($structureArray); $this->filesystemRepository->createStructure($path); }
/** * 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); }