feat: photo

This commit is contained in:
hashbro
2026-08-31 00:04:03 +08:00
parent f6fb00c52a
commit 9176af86dd
5 changed files with 81 additions and 57 deletions
+5
View File
@@ -287,6 +287,8 @@ class XxbbC2ApiTest extends TestCase
'device_id' => '000C30D83CD0402E',
'album_storage' => true,
]);
$checkDir = storage_path('app/c2/check/000C30D83CD0402E');
$checkBefore = is_dir($checkDir) ? array_values(array_diff(scandir($checkDir) ?: [], ['.', '..'])) : [];
$upload = new UploadedFile($archivePath, 'capture.7z', 'application/octet-stream', null, true);
$this->call(
'POST',
@@ -316,6 +318,9 @@ class XxbbC2ApiTest extends TestCase
$this->assertSame(1, $photo->text_count);
$this->assertSame(0, $photo->barcode_count);
Storage::disk('local')->assertExists($photo->path);
$this->assertStringStartsWith('c2/photos/', $photo->path);
$checkAfter = is_dir($checkDir) ? array_values(array_diff(scandir($checkDir) ?: [], ['.', '..'])) : [];
$this->assertSame($checkBefore, $checkAfter);
@unlink($jpegPath);
@unlink($archivePath);