|
|
@@ -23,7 +23,7 @@ class InventoryAccountTest extends TestCase
|
|
|
$total=$this->inventory['total'];
|
|
|
for ($i=0;$i<$total;$i++){
|
|
|
$this->inventoryMissions=InventoryAccountMission::create([
|
|
|
- 'inventory_id'=>$this->inventory['id'],
|
|
|
+ 'inventory_account_id'=>$this->inventory['id'],
|
|
|
'location'=>Str::random(5),
|
|
|
'commodity_id'=>256226,
|
|
|
'produced_at'=>null,
|
|
|
@@ -49,28 +49,28 @@ class InventoryAccountTest extends TestCase
|
|
|
}
|
|
|
|
|
|
function testInventoryMissions(){
|
|
|
- $this->assertEquals($this->inventory->id,$this->inventory->inventoryMissions['inventory_id']);
|
|
|
+ $this->assertEquals($this->inventory->id,$this->inventory->inventoryMissions['inventory_account_id']);
|
|
|
}
|
|
|
function testGetSurplusAttribute(){
|
|
|
$surplus=$this->inventory['surplus'];
|
|
|
$this->assertEquals($surplus,$this->inventory['total']-$this->inventory['processed']);
|
|
|
}
|
|
|
function testGetProcessedAmount(){
|
|
|
- $processed=InventoryAccountMission::where('inventory_id',$this->inventory['id'])->where('checked','是')->count();
|
|
|
+ $processed=InventoryAccountMission::where('inventory_account_id',$this->inventory['id'])->where('checked','是')->count();
|
|
|
$this->assertEquals($processed,$this->inventory['processed']);
|
|
|
}
|
|
|
function testGetDifferenceAmount(){
|
|
|
- $difference=InventoryAccountMission::where('inventory_id',$this->inventory['id'])->where('difference_amount','>',0)->count();
|
|
|
+ $difference=InventoryAccountMission::where('inventory_account_id',$this->inventory['id'])->where('difference_amount','>',0)->count();
|
|
|
$this->assertEquals($difference,$this->inventory['difference']);
|
|
|
}
|
|
|
function testGetReturnedAmount(){
|
|
|
- $returned=InventoryAccountMission::where('inventory_id',$this->inventory['id'])->where('returned','是')->count();
|
|
|
+ $returned=InventoryAccountMission::where('inventory_account_id',$this->inventory['id'])->where('returned','是')->count();
|
|
|
$this->assertEquals($returned,$this->inventory['returned']);
|
|
|
}
|
|
|
|
|
|
function tearDown(): void
|
|
|
{
|
|
|
- InventoryAccountMission::where('inventory_id',$this->inventory['id'])->delete();
|
|
|
+ InventoryAccountMission::where('inventory_account_id',$this->inventory['id'])->delete();
|
|
|
InventoryAccount::where('id',$this->inventory['id'])->forceDelete();
|
|
|
parent::tearDown(); // TODO: Change the autogenerated stub
|
|
|
}
|