add tests batch 20

This commit is contained in:
root
2026-06-09 01:03:53 -04:00
parent 95efb9652e
commit 6be4875c5e
1502 changed files with 13797 additions and 11313 deletions
@@ -15,13 +15,13 @@ class FileServeServiceTest extends TestCase
public function test_meta_returns_file_metadata(): void
{
$dir = storage_path('testing/files');
if (! is_dir($dir)) {
if (!is_dir($dir)) {
mkdir($dir, 0777, true);
}
$path = $dir.DIRECTORY_SEPARATOR.'sample.pdf';
$path = $dir . DIRECTORY_SEPARATOR . 'sample.pdf';
file_put_contents($path, 'PDFDATA');
$service = new FileServeService;
$service = new FileServeService();
$meta = $service->meta($dir, 'sample.pdf', ['pdf'], 'download');
$this->assertSame('sample.pdf', $meta['name']);
@@ -33,13 +33,13 @@ class FileServeServiceTest extends TestCase
public function test_serve_inline_returns_304_when_etag_matches(): void
{
$dir = storage_path('testing/files');
if (! is_dir($dir)) {
if (!is_dir($dir)) {
mkdir($dir, 0777, true);
}
$path = $dir.DIRECTORY_SEPARATOR.'cached.pdf';
$path = $dir . DIRECTORY_SEPARATOR . 'cached.pdf';
file_put_contents($path, 'PDFDATA');
$service = new FileServeService;
$service = new FileServeService();
$meta = $service->meta($dir, 'cached.pdf', ['pdf']);
$request = Request::create('/files/cached.pdf', 'GET', [], [], [], [
@@ -57,13 +57,13 @@ class FileServeServiceTest extends TestCase
$this->expectException(HttpException::class);
$dir = storage_path('testing/files');
if (! is_dir($dir)) {
if (!is_dir($dir)) {
mkdir($dir, 0777, true);
}
$path = $dir.DIRECTORY_SEPARATOR.'sample.exe';
$path = $dir . DIRECTORY_SEPARATOR . 'sample.exe';
file_put_contents($path, 'DATA');
$service = new FileServeService;
$service = new FileServeService();
$service->meta($dir, 'sample.exe', ['pdf']);
}
}