GetTasksTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Tests\Services\CacheShelfService;
  3. use App\MaterialBox;
  4. use App\Services\CacheShelfService;
  5. use App\Station;
  6. use Tests\TestCase;
  7. class GetTasksTest extends TestCase
  8. {
  9. /** @var CacheShelfService $service */
  10. protected $service;
  11. protected $data = [];
  12. protected function setup(): void
  13. {
  14. parent::setup();
  15. $this->service = app(CacheShelfService::class);
  16. $this->data['parentStation'] = factory(Station::class)->create(['code' => '']);
  17. $this->data['station'] = factory(Station::class)->create(['code'=>'','parent_id'=>$this->data['parentStation']['id']]);
  18. $this->data['materialBox']=factory(MaterialBox::class)->create(['code'=> '']);
  19. }
  20. public function testGetTasks()
  21. {
  22. $grids = $this->service->getTasks($this->data['station']);
  23. }
  24. protected function tearDown(): void
  25. {
  26. Station::query()->where('id', $this->data['station']['id'])->delete();
  27. parent::tearDown(); // TODO: Change the autogenerated stub
  28. }
  29. }