| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Tests\Inventory\Services\InventoryService;
- use App\Inventory;
- use App\InventoryMission;
- use App\Services\InventoryService;
- use Tests\TestCase;
- class InventoryService_CreateMissionTest extends TestCase
- {
- public $inventory;
- public $inventoryMissions;
- function setUp(): void
- {
- parent::setUp(); // TODO: Change the autogenerated stub
- }
- function testCreateMissionsFail(){
- $realService=new InventoryService();
- $this->inventory=$realService->createMission('2020-08-20','2020-08-20','');
- $this->assertNull($this->inventory);
- }
- function testCreateMissionsSuccess(){
- $realService=new InventoryService();
- $this->inventory=$realService->createMission('2020-08-20','2020-08-20',3);
- $this->assertIsObject($this->inventory);
- $this->assertNotEmpty($this->inventory);
- }
- function tearDown(): void
- {
- InventoryMission::where('inventory_id',$this->inventory['id'])->delete();
- Inventory::where('id',$this->inventory['id'])->forceDelete();
- parent::tearDown(); // TODO: Change the autogenerated stub
- }
- }
|