| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace Tests\Services\BatchService;
- use App\Services\BatchService;
- use Tests\TestCase;
- use App\Batch;
- use App\Traits\TestMockSubServices;
- class AssignTasksTest extends TestCase
- {
- use TestMockSubServices;
- /** @var BatchService $service */
- public $service;
- private $data;
- private $amount=2;
- function setUp(): void
- {
- parent::setUp();
- $this->service = app('BatchService');
- $this->data['Batches']
- = factory(Batch::class, $this->amount)
- ->create();
- }
- public function testReturned()
- {
- $this->service->assignTasks($this->data['Batches']);
- $this->assertTrue(true);
- }
- function tearDown(): void
- {
- Batch::query()
- ->whereIn('id',data_get($this->data['Batches'],'*.id')??[])
- ->delete();
- parent::tearDown();
- }
- }
|