You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
json2db/tests/Unit/Jobs/ChunkFileTest.php

39 lines
856 B

<?php
namespace Tests\Unit\Jobs;
use App\Enums\FileFormatEnum;
use App\Jobs\ChunkFile;
use App\Jobs\StoreChunk;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Tests\TestCase;
use Illuminate\Support\Facades\Bus;
class ChunkFileTest extends TestCase
{
/**
* A basic unit test example.
*
* @return void
* @group convert
*/
public function test_chunk_json_file()
{
Bus::fake();
$path = base_path('/tests/Storage/ConvertJsonTest.json');
Storage::shouldReceive('path')->andReturn($path);
Storage::shouldReceive('delete')->andReturnTrue();
(new ChunkFile(
Str::uuid(),
$path,
FileFormatEnum::JSON
))->handle();
Bus::assertDispatched(StoreChunk::class, 1);
}
}