LightOnTest.php 813 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Tests\Services\CacheShelfService;
  3. use App\Services\CacheShelfService;
  4. use App\Station;
  5. use Tests\TestCase;
  6. class LightOnTest extends testcase
  7. {
  8. /** @var CacheShelfService $service */
  9. protected $service;
  10. protected $data = [];
  11. protected function setup(): void
  12. {
  13. parent::setUp();
  14. $this->service = app(CacheShelfService::class);
  15. $this->data['station'] = factory(Station::class)->create();
  16. }
  17. public function testLightOn()
  18. {
  19. $row = ''; // 从右到左
  20. $col = ''; // 从下到上
  21. $this->service->lightOn($this->data['station'],$row,$col);
  22. }
  23. protected function tearDown(): void
  24. {
  25. Station::query()->where('id',$this->data['station']['id'])->delete();
  26. parent::tearDown();
  27. }
  28. }