|
|
@@ -137,9 +137,9 @@ class OwnerPriceOperationServiceTest extends TestCase
|
|
|
/** @var Mock $mock */
|
|
|
$mock->shouldReceive("matchFeature")->andReturn(true);
|
|
|
});
|
|
|
- $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>55]]],[],$this->data["owners"][0]["id"],$this->data["commodities"][0]["sku"],"入库");
|
|
|
+ $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>55,"sku"=>$this->data["commodities"][0]["sku"]]]],[],$this->data["owners"][0]["id"],"入库");
|
|
|
$this->assertEquals(12.88,$result);
|
|
|
- $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>57]]],[],$this->data["owners"][0]["id"],$this->data["commodities"][0]["sku"],"出库");
|
|
|
+ $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>57,"sku"=>$this->data["commodities"][0]["sku"]]]],[],$this->data["owners"][0]["id"],"出库");
|
|
|
$this->assertEquals(99.5,$result);
|
|
|
}
|
|
|
/**
|
|
|
@@ -147,9 +147,9 @@ class OwnerPriceOperationServiceTest extends TestCase
|
|
|
*/
|
|
|
public function testMatchRule1()
|
|
|
{
|
|
|
- $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>56]]],[],$this->data["owners"][0]["id"],$this->data["commodities"][0]["sku"],"入库");
|
|
|
+ $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>56,"sku"=>$this->data["commodities"][0]["sku"]]]],[],$this->data["owners"][0]["id"],"入库");
|
|
|
$this->assertEquals(26.64,$result);
|
|
|
- $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>58]]],[],$this->data["owners"][0]["id"],$this->data["commodities"][0]["sku"],"出库");
|
|
|
+ $result = $this->service->matchRule(["packages"=>[["commodity"=>"测试","amount"=>58,"sku"=>$this->data["commodities"][0]["sku"]]]],[],$this->data["owners"][0]["id"],"出库");
|
|
|
$this->assertEquals(58.4,$result);
|
|
|
}
|
|
|
|