InventoryService_GetTest.php 648 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Tests\Inventory\Services\InventoryService;
  3. use App\Inventory;
  4. use App\Services\InventoryService;
  5. use Tests\TestCase;
  6. class InventoryService_GetTest extends TestCase
  7. {
  8. public $inventories;
  9. public $inventorys;
  10. public $queryParam=[];
  11. function testGet(){
  12. $inventoryService=new InventoryService();
  13. $this->inventories=$inventoryService->get($this->queryParam);
  14. $this->inventorys=Inventory::with(['owner'])->orderBy('id','desc')->get();
  15. $this->assertEquals(count($this->inventorys),count($this->inventories));
  16. $this->assertEquals($this->inventorys,$this->inventories);
  17. }
  18. }