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.
38 lines
983 B
38 lines
983 B
<?php
|
|
|
|
namespace Tests\Unit\Jobs;
|
|
|
|
use App\Jobs\StoreChunk;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Sequence;
|
|
use Tests\TestCase;
|
|
|
|
class StoreChunkTest extends TestCase
|
|
{
|
|
/**
|
|
* A basic unit test example.
|
|
*
|
|
* @return void
|
|
* @group convert2
|
|
*/
|
|
public function test_store_chunk()
|
|
{
|
|
(new StoreChunk(
|
|
User::factory()->count(99)->state(
|
|
new Sequence(
|
|
[
|
|
'date_of_birth' => fake()->dateTimeBetween('-70 years', '-66 years'),
|
|
],
|
|
[
|
|
'date_of_birth' => fake()->dateTimeBetween('-65 years', '-18 years'),
|
|
],
|
|
[
|
|
'date_of_birth' => fake()->dateTimeBetween('-18 years', 'now'),
|
|
]
|
|
)
|
|
)->make()->toArray()
|
|
))->handle();
|
|
|
|
$this->assertDatabaseCount('users', 33);
|
|
}
|
|
}
|
|
|