Files
Testing/tus-php/tests/Fixtures/FileFixture.php

30 lines
549 B
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<?php
namespace TusPhp\Test\Fixtures;
class FileFixture
{
/**
* Make files and folder.
*
* @param string $path
* @param array $files
*
* @return void
*/
public static function makeFilesAndFolder(string $path, array $files) : void
{
if ( ! file_exists($path)) {
mkdir($path);
}
foreach ($files as $file) {
$filePath = $file['file_path'];
touch($filePath);
file_put_contents($filePath, basename($filePath));
}
}
}