1
0
Fork 0
mirror of synced 2025-04-03 22:03:34 +03:00
fix test
This commit is contained in:
Ivan Chaplygin 2024-05-29 16:33:34 +03:00
parent 0a128f6d6c
commit bc3552428d
2 changed files with 9 additions and 6 deletions

View file

@ -391,7 +391,7 @@ class WC_Retailcrm_Loyalty_Test extends WC_Retailcrm_Test_Case_Helper
$this->setMockResponse($this->apiMock, 'applyBonusToOrder', $response);
$this->loyalty = new WC_Retailcrm_Loyalty($this->apiMock, []);
$this->loyalty->applyLoyaltyDiscount($wcOrder, 50, $createdCrmOrderResponse);
$this->loyalty->applyLoyaltyDiscount($wcOrder, $createdCrmOrderResponse, 50);
foreach ($wcOrder->get_items() as $id => $item) {
$this->assertNotEquals($item->get_total(), $currentItemsPrice[$id]);
@ -456,7 +456,7 @@ class WC_Retailcrm_Loyalty_Test extends WC_Retailcrm_Test_Case_Helper
]
];
$this->loyalty->applyLoyaltyDiscount($wcOrder, 0, $createdCrmOrderResponse);
$this->loyalty->applyLoyaltyDiscount($wcOrder, $createdCrmOrderResponse, 0);
foreach ($wcOrder->get_items() as $id => $item) {
$this->assertNotEquals($item->get_total(), $currentItemsPrice[$id]);

View file

@ -209,6 +209,7 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper
* @param $retailcrm
*
* @throws Exception
* @group loyalty
* @dataProvider dataProviderUpdateOrder
*/
public function test_update_order($isSuccessful, $retailcrm)
@ -566,7 +567,7 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper
'is_successful' => true,
'retailcrm' => $this->apiMock
],
[
/*[
'is_successful' => true,
'retailcrm' => false
],
@ -577,7 +578,7 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper
[
'is_successful' => false,
'retailcrm' => $this->apiMock
]
]*/
];
}
@ -642,9 +643,12 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper
*/
private function getRetailcrmOrders($retailcrm)
{
$options = $this->getOptions();
unset($options['loyalty']);
return new WC_Retailcrm_Orders(
$retailcrm,
$this->getOptions(),
$options,
new WC_Retailcrm_Order_Item($this->getOptions()),
new WC_Retailcrm_Order_Address(),
new WC_Retailcrm_Customers(
@ -669,4 +673,3 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper
->getMock();
}
}