feat: photo
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user