From 617527035d6a0b1efa66222885f973eca8bd0fdb Mon Sep 17 00:00:00 2001 From: Uryvskiy Dima Date: Mon, 4 Dec 2023 09:47:07 +0300 Subject: [PATCH] Added support WooCommerce 8.2 (HPOS) --- .../class-wc-retailcrm-abstracts-settings.php | 9 +- .../api/class-wc-retailcrm-response.php | 42 ++-- src/include/class-wc-retailcrm-orders.php | 67 ++++-- src/include/class-wc-retailcrm-uploader.php | 63 +++--- src/include/functions.php | 14 +- tests/test-wc-retailcrm-history.php | 210 +++--------------- tests/test-wc-retailcrm-orders.php | 22 +- tests/test-wc-retailcrm-uploader.php | 2 +- 8 files changed, 162 insertions(+), 267 deletions(-) diff --git a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php index cadf1ef..7fc1a89 100644 --- a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php +++ b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php @@ -144,11 +144,11 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration ), ]; - foreach (get_post_statuses() as $status_key => $status_value) { - $this->form_fields['p_' . $status_key] = [ - 'title' => $status_value, + // Used to select product statuses + foreach (get_post_statuses() as $statusKey => $statusValue) { + $this->form_fields['p_' . $statusKey] = [ + 'title' => $statusValue, 'label' => ' ', - 'description' => '', 'class' => 'checkbox', 'type' => 'checkbox', 'desc_tip' => true, @@ -875,6 +875,7 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration */ public function validate_whatsapp_number_field($key, $value) { + // Checking the activity of the option for validating a phone number. $post = $this->get_post_data(); if (!empty($post['woocommerce_integration-retailcrm_whatsapp_active'])) { diff --git a/src/include/api/class-wc-retailcrm-response.php b/src/include/api/class-wc-retailcrm-response.php index 48e4c9a..96ea479 100644 --- a/src/include/api/class-wc-retailcrm-response.php +++ b/src/include/api/class-wc-retailcrm-response.php @@ -170,30 +170,32 @@ class WC_Retailcrm_Response implements \ArrayAccess return $this->response[$offset]; } - /** - * Returns error string. If there's multiple errors present - they will be squashed into single string. - * - * @return string - */ - public function getErrorString() - { - if ($this->offsetExists('error')) { - return (string) $this->response['error']; - } elseif ($this->offsetExists('errors') && is_array($this->response['errors'])) { - $errorMessage = ''; + /** + * Returns error string. If there's multiple errors present - they will be squashed into single string. + * + * @return string + */ + public function getErrorString() + { + if ($this->offsetExists('errorMsg')) { + return (string) $this->response['errorMsg']; + } - foreach ($this->response['errors'] as $error) { - $errorMessage .= $error . ' >'; - } + if (is_array($this->response['errors']) && $this->offsetExists('errors')) { + $errorMessage = ''; - if (strlen($errorMessage) > 2) { - return (string) substr($errorMessage, 0, strlen($errorMessage) - 2); - } + foreach ($this->response['errors'] as $error) { + $errorMessage .= $error . ' >'; + } - return $errorMessage; - } + if (strlen($errorMessage) > 2) { + return (string) substr($errorMessage, 0, strlen($errorMessage) - 2); + } - return ''; + return $errorMessage; + } + + return ''; } /** diff --git a/src/include/class-wc-retailcrm-orders.php b/src/include/class-wc-retailcrm-orders.php index d7261d3..7786d96 100644 --- a/src/include/class-wc-retailcrm-orders.php +++ b/src/include/class-wc-retailcrm-orders.php @@ -72,34 +72,40 @@ if (!class_exists('WC_Retailcrm_Orders')) : /** * Create order. Returns wc_get_order data or error string. * - * @param $order_id + * @param $orderId * - * @return bool|WC_Order|WC_Order_Refund|string + * @return bool|WC_Order|string * @throws \Exception */ - public function orderCreate($order_id) + public function orderCreate($orderId) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) { return null; } - $this->order_payment->resetData(); - - $wcOrder = wc_get_order($order_id); - $this->processOrder($wcOrder); - try { + $this->order_payment->resetData(); + + $wcOrder = wc_get_order($orderId); + + $this->processOrder($wcOrder); + $response = $this->retailcrm->ordersCreate($this->order); - if ($response instanceof WC_Retailcrm_Proxy) { - if ($response->isSuccessful()) { - return $wcOrder; - } - + if (!$response instanceof WC_Retailcrm_Response || !$response->isSuccessful()) { return $response->getErrorString(); } - } catch (InvalidArgumentException $exception) { - return $exception->getMessage(); + } catch (Throwable $exception) { + writeBaseLogs( + sprintf( + 'Error message: %s, file: %s on line: %s', + $exception->getMessage(), + $exception->getFile(), + $exception->getLine() + ) + ); + + return null; } return $wcOrder; @@ -252,25 +258,38 @@ if (!class_exists('WC_Retailcrm_Orders')) : /** * Edit order in CRM * - * @param int $order_id + * @param int $orderId * * @return WC_Order $order | null * @throws \Exception */ - public function updateOrder($order_id) + public function updateOrder($orderId) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) { return null; } - $wcOrder = wc_get_order($order_id); + try { + $wcOrder = wc_get_order($orderId); - $this->processOrder($wcOrder, true); + $this->processOrder($wcOrder, true); - $response = $this->retailcrm->ordersEdit($this->order); + $response = $this->retailcrm->ordersEdit($this->order); - if (!empty($response) && $response->isSuccessful()) { - $this->payment = $this->orderUpdatePaymentType($wcOrder); + if ($response instanceof WC_Retailcrm_Response && $response->isSuccessful()) { + $this->payment = $this->orderUpdatePaymentType($wcOrder); + } + } catch (Throwable $exception) { + writeBaseLogs( + sprintf( + 'Error message: %s, file: %s on line: %s', + $exception->getMessage(), + $exception->getFile(), + $exception->getLine() + ) + ); + + return null; } return $wcOrder; @@ -337,11 +356,11 @@ if (!class_exists('WC_Retailcrm_Orders')) : return; } - if ($order->get_status() == 'auto-draft') { + if ('auto-draft' === $order->get_status()) { return; } - if ($update === true) { + if ($update) { $this->orders->is_new = false; } diff --git a/src/include/class-wc-retailcrm-uploader.php b/src/include/class-wc-retailcrm-uploader.php index b4822be..4964cc4 100644 --- a/src/include/class-wc-retailcrm-uploader.php +++ b/src/include/class-wc-retailcrm-uploader.php @@ -59,11 +59,13 @@ if (class_exists('WC_Retailcrm_Uploader') === false) { */ public function uploadSelectedOrders() { - if (!empty($_GET['order_ids_retailcrm'])) { - $ids = array_unique(explode(',', $_GET['order_ids_retailcrm'])); - - if (!empty($ids)) { - $this->uploadArchiveOrders(0, $ids); + $ids = $_GET['order_ids_retailcrm']; + + if (!empty($ids)) { + preg_match_all('/\d+/', $ids, $matches); + + if (!empty($matches[0])) { + $this->uploadArchiveOrders(null, $matches[0]); } } } @@ -71,29 +73,31 @@ if (class_exists('WC_Retailcrm_Uploader') === false) { /** * Uploads archive order in CRM * - * @param int $page Number page uploads. - * @param array $ids Ids orders upload. + * @param null|int $page Number page uploads. + * @param array $ids Ids orders upload. * * @return void|null * @throws Exception Invalid argument exception. */ - public function uploadArchiveOrders($page, $ids = array()) + public function uploadArchiveOrders($page, $ids = []) { if (!$this->retailcrm instanceof WC_Retailcrm_Proxy) { return null; } - $uploadErrors = array(); - $ordersCms = $this->getCmsOrders($page, $ids); + $orderIds = []; + $uploadErrors = []; - foreach ($ordersCms as $dataOrder) { - $orderId = $dataOrder->ID; + if (null !== $page) { + $orderIds = $this->getCmsOrders($page); + } elseif ([] !== $ids) { + $orderIds = $ids; + } + + foreach ($orderIds as $orderId) { $errorMessage = $this->orders->orderCreate($orderId); - if (true === is_string($errorMessage)) { - $errorMessage = empty($errorMessage) === true - ? 'Order exist. External id: ' . $orderId - : $errorMessage; + if (is_string($errorMessage)) { $uploadErrors[$orderId] = $errorMessage; } } @@ -118,7 +122,7 @@ if (class_exists('WC_Retailcrm_Uploader') === false) { $users = $this->getCmsUsers($page); if (false === empty($users)) { - $dataCustomers = array(); + $dataCustomers = []; foreach ($users as $user) { if ($this->customers->isCustomer($user) === false) { @@ -140,20 +144,19 @@ if (class_exists('WC_Retailcrm_Uploader') === false) { * Return orders ids * * @param integer $page Number page uploads. - * @param array $ids Ids orders upload. * * @return mixed */ - private function getCmsOrders($page, $ids = array()) + private function getCmsOrders($page) { - return get_posts( - array( - 'numberposts' => self::RETAILCRM_COUNT_OBJECT_UPLOAD, - 'offset' => self::RETAILCRM_COUNT_OBJECT_UPLOAD * $page, - 'post_type' => wc_get_order_types('view-orders'), - 'post_status' => array_keys(wc_get_order_statuses()), - 'include' => $ids, - ) + return wc_get_orders( + [ + 'type' => wc_get_order_types('view-orders'), + 'limit' => self::RETAILCRM_COUNT_OBJECT_UPLOAD, + 'status' => array_keys(wc_get_order_statuses()), + 'offset' => self::RETAILCRM_COUNT_OBJECT_UPLOAD * $page, + 'return' => 'ids', + ] ); } @@ -179,13 +182,13 @@ if (class_exists('WC_Retailcrm_Uploader') === false) { * * @return mixed */ - private function getCmsUsers($page) + private function getCmsUsers(int $page) { return get_users( - array( + [ 'number' => self::RETAILCRM_COUNT_OBJECT_UPLOAD, 'offset' => self::RETAILCRM_COUNT_OBJECT_UPLOAD * $page, - ) + ] ); } diff --git a/src/include/functions.php b/src/include/functions.php index b04493f..2440569 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -1,5 +1,7 @@ deleteAllData(); $this->regenerateMocks(); - $order_id = $this->history_order_create_for_changing_customer(); - $this->assertNotEmpty($order_id); + + $orderId = $this->history_order_create_for_changing_customer(); + + $this->assertNotEmpty($orderId); $this->regenerateMocks(); - $this->history_order_switch_customer($order_id); + $this->history_order_switch_customer($orderId); $this->regenerateMocks(); - $this->history_order_switch_customer_to_corporate($order_id); + $this->history_order_switch_customer_to_corporate($orderId); $this->regenerateMocks(); - $this->history_order_switch_customer_to_another_corporate($order_id); + $this->history_order_switch_customer_to_another_corporate($orderId); $this->regenerateMocks(); - $this->history_order_switch_only_company($order_id); + $this->history_order_switch_only_company($orderId); $this->regenerateMocks(); - $this->history_order_switch_only_contact($order_id); + $this->history_order_switch_only_contact($orderId); $this->regenerateMocks(); - $this->history_order_switch_back_to_individual($order_id); + $this->history_order_switch_back_to_individual($orderId); } public function history_order_create_for_changing_customer() @@ -376,16 +378,16 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper } /** - * @param int $order_id + * @param int $orderId * * @throws \Exception */ - public function history_order_switch_customer($order_id) + public function history_order_switch_customer(int $orderId) { $this->mockHistory( true, DataHistoryRetailCrm::empty_history(), - DataHistoryRetailCrm::get_history_change_to_another_individual($order_id) + DataHistoryRetailCrm::get_history_change_to_another_individual($orderId) ); $this->ordersGetMock( @@ -396,31 +398,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper $retailcrm_history = new \WC_Retailcrm_History($this->apiMock); $retailcrm_history->getHistory(); - try { - $order = new WC_Order($order_id); - } catch (\Exception $exception) { - $post = get_post($order_id); - - if (!$post instanceof WP_Post) { - $this->fail(sprintf('Cannot find order with id=%d', $order_id)); - } - - if (!in_array($post->post_type, wc_get_order_types())) { - $this->fail(sprintf( - 'Invalid order post type `%s`. Should be one of these: %s', - $post->post_type, - implode(', ', wc_get_order_types()) - )); - } else { - $this->fail(sprintf( - 'Cannot determine what\'s wrong with order id=%d. Message from WooCommerce: %s', - $order_id, - $exception->getMessage() - )); - } - - return; - } + $order = new WC_Order($orderId); $this->assertEquals('tester002', $order->get_billing_first_name()); $this->assertEquals('tester002', $order->get_billing_last_name()); @@ -437,16 +415,16 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper } /** - * @param int $order_id + * @param int $orderId * * @throws \Exception */ - public function history_order_switch_customer_to_corporate($order_id) + public function history_order_switch_customer_to_corporate(int $orderId) { $this->mockHistory( true, DataHistoryRetailCrm::empty_history(), - DataHistoryRetailCrm::get_history_change_to_corporate($order_id) + DataHistoryRetailCrm::get_history_change_to_corporate($orderId) ); $this->ordersGetMock( @@ -462,31 +440,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper $retailcrm_history = new \WC_Retailcrm_History($this->apiMock); $retailcrm_history->getHistory(); - try { - $order = new WC_Order($order_id); - } catch (\Exception $exception) { - $post = get_post($order_id); - - if (!$post instanceof WP_Post) { - $this->fail(sprintf('Cannot find order with id=%d', $order_id)); - } - - if (!in_array($post->post_type, wc_get_order_types())) { - $this->fail(sprintf( - 'Invalid order post type `%s`. Should be one of these: %s', - $post->post_type, - implode(', ', wc_get_order_types()) - )); - } else { - $this->fail(sprintf( - 'Cannot determine what\'s wrong with order id=%d. Message from WooCommerce: %s', - $order_id, - $exception->getMessage() - )); - } - - return; - } + $order = new WC_Order($orderId); $this->assertEquals('psycho913', $order->get_billing_first_name()); $this->assertEquals('psycho913', $order->get_billing_last_name()); @@ -500,16 +454,16 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper } /** - * @param int $order_id + * @param int $orderId * * @throws \Exception */ - public function history_order_switch_customer_to_another_corporate($order_id) + public function history_order_switch_customer_to_another_corporate($orderId) { $this->mockHistory( true, DataHistoryRetailCrm::empty_history(), - DataHistoryRetailCrm::get_history_change_to_another_corporate($order_id) + DataHistoryRetailCrm::get_history_change_to_another_corporate($orderId) ); $this->ordersGetMock( @@ -525,31 +479,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper $retailcrm_history = new \WC_Retailcrm_History($this->apiMock); $retailcrm_history->getHistory(); - try { - $order = new WC_Order($order_id); - } catch (\Exception $exception) { - $post = get_post($order_id); - - if (!$post instanceof WP_Post) { - $this->fail(sprintf('Cannot find order with id=%d', $order_id)); - } - - if (!in_array($post->post_type, wc_get_order_types())) { - $this->fail(sprintf( - 'Invalid order post type `%s`. Should be one of these: %s', - $post->post_type, - implode(', ', wc_get_order_types()) - )); - } else { - $this->fail(sprintf( - 'Cannot determine what\'s wrong with order id=%d. Message from WooCommerce: %s', - $order_id, - $exception->getMessage() - )); - } - - return; - } + $order = new WC_Order($orderId); $this->assertEquals('Tester4867', $order->get_billing_first_name()); $this->assertEquals('Tester4867', $order->get_billing_last_name()); @@ -564,16 +494,16 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper } /** - * @param int $order_id + * @param int $orderId * * @throws \Exception */ - public function history_order_switch_only_company($order_id) + public function history_order_switch_only_company(int $orderId) { $this->mockHistory( true, DataHistoryRetailCrm::empty_history(), - DataHistoryRetailCrm::get_history_change_only_company($order_id) + DataHistoryRetailCrm::get_history_change_only_company($orderId) ); $this->ordersGetMock( @@ -589,31 +519,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper $retailcrm_history = new \WC_Retailcrm_History($this->apiMock); $retailcrm_history->getHistory(); - try { - $order = new WC_Order($order_id); - } catch (\Exception $exception) { - $post = get_post($order_id); - - if (!$post instanceof WP_Post) { - $this->fail(sprintf('Cannot find order with id=%d', $order_id)); - } - - if (!in_array($post->post_type, wc_get_order_types())) { - $this->fail(sprintf( - 'Invalid order post type `%s`. Should be one of these: %s', - $post->post_type, - implode(', ', wc_get_order_types()) - )); - } else { - $this->fail(sprintf( - 'Cannot determine what\'s wrong with order id=%d. Message from WooCommerce: %s', - $order_id, - $exception->getMessage() - )); - } - - return; - } + $order = new WC_Order($orderId); $this->assertEquals('Tester4867', $order->get_billing_first_name()); $this->assertEquals('Tester4867', $order->get_billing_last_name()); @@ -628,16 +534,16 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper } /** - * @param int $order_id + * @param int $orderId * * @throws \Exception */ - public function history_order_switch_only_contact($order_id) + public function history_order_switch_only_contact(int $orderId) { $this->mockHistory( true, DataHistoryRetailCrm::empty_history(), - DataHistoryRetailCrm::get_history_change_only_contact($order_id) + DataHistoryRetailCrm::get_history_change_only_contact($orderId) ); $this->ordersGetMock( @@ -653,31 +559,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper $retailcrm_history = new \WC_Retailcrm_History($this->apiMock); $retailcrm_history->getHistory(); - try { - $order = new WC_Order($order_id); - } catch (\Exception $exception) { - $post = get_post($order_id); - - if (!$post instanceof WP_Post) { - $this->fail(sprintf('Cannot find order with id=%d', $order_id)); - } - - if (!in_array($post->post_type, wc_get_order_types())) { - $this->fail(sprintf( - 'Invalid order post type `%s`. Should be one of these: %s', - $post->post_type, - implode(', ', wc_get_order_types()) - )); - } else { - $this->fail(sprintf( - 'Cannot determine what\'s wrong with order id=%d. Message from WooCommerce: %s', - $order_id, - $exception->getMessage() - )); - } - - return; - } + $order = new WC_Order($orderId); $this->assertEquals('Tester2890', $order->get_billing_first_name()); $this->assertEquals('Tester2890', $order->get_billing_last_name()); @@ -692,16 +574,16 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper } /** - * @param int $order_id + * @param int $orderId * * @throws \Exception */ - public function history_order_switch_back_to_individual($order_id) + public function history_order_switch_back_to_individual(int $orderId) { $this->mockHistory( true, DataHistoryRetailCrm::empty_history(), - DataHistoryRetailCrm::get_history_change_from_corporate_to_individual($order_id) + DataHistoryRetailCrm::get_history_change_from_corporate_to_individual($orderId) ); $this->ordersGetMock( @@ -712,31 +594,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper $retailcrm_history = new \WC_Retailcrm_History($this->apiMock); $retailcrm_history->getHistory(); - try { - $order = new WC_Order($order_id); - } catch (\Exception $exception) { - $post = get_post($order_id); - - if (!$post instanceof WP_Post) { - $this->fail(sprintf('Cannot find order with id=%d', $order_id)); - } - - if (!in_array($post->post_type, wc_get_order_types())) { - $this->fail(sprintf( - 'Invalid order post type `%s`. Should be one of these: %s', - $post->post_type, - implode(', ', wc_get_order_types()) - )); - } else { - $this->fail(sprintf( - 'Cannot determine what\'s wrong with order id=%d. Message from WooCommerce: %s', - $order_id, - $exception->getMessage() - )); - } - - return; - } + $order = new WC_Order($orderId); $this->assertEquals('tester001', $order->get_billing_first_name()); $this->assertEquals('tester001', $order->get_billing_last_name()); diff --git a/tests/test-wc-retailcrm-orders.php b/tests/test-wc-retailcrm-orders.php index 4aba7a9..d8527f1 100644 --- a/tests/test-wc-retailcrm-orders.php +++ b/tests/test-wc-retailcrm-orders.php @@ -55,6 +55,8 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper */ public function test_order_create($retailcrm) { + $this->createTestOrder(); + if ($retailcrm) { $responseMock = $this->createResponseMock(); $responseMockCustomers = $this->createResponseMock(); @@ -68,13 +70,12 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper ] ); + $this->setMockResponse($responseMock, 'isSuccessful', true); $this->setMockResponse($retailcrm, 'ordersCreate', $responseMock); $this->setMockResponse($retailcrm, 'customersCreate', $responseMock); $this->setMockResponse($retailcrm, 'customersList', $responseMockCustomers); } - $this->createTestOrder(); - $retailcrmOrders = $this->getRetailcrmOrders($retailcrm); $order = $retailcrmOrders->orderCreate($this->order->get_id()); $orderData = $retailcrmOrders->getOrder(); @@ -132,6 +133,8 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper */ public function test_order_create_with_corporate_customer($retailcrm) { + $this->createTestOrder(); + if ($retailcrm) { $responseMock = $this->createResponseMock(); @@ -170,6 +173,7 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper ] ); + $this->setMockResponse($responseMock, 'isSuccessful', true); $this->setMockResponse($retailcrm, 'ordersCreate', $responseMock); $this->setMockResponse($retailcrm, 'getSingleSiteForKey', 'woo'); $this->setMockResponse($retailcrm, 'customersCorporateCreate', $responseMockCustomerCorporate); @@ -180,8 +184,6 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper $this->setMockResponse($retailcrm, 'customersCorporateCompanies', $responseMockCompany); } - $this->createTestOrder(); - $retailcrmOrders = $this->getRetailcrmOrders($retailcrm); $order = $retailcrmOrders->orderCreate($this->order->get_id()); $orderData = $retailcrmOrders->getOrder(); @@ -609,14 +611,12 @@ class WC_Retailcrm_Orders_Test extends WC_Retailcrm_Test_Case_Helper } } + $this->order->add_meta_data('woo_order', 'test_custom_fields'); + $this->order->add_meta_data('crm_phone', '1111122222'); + $this->order->add_meta_data('crm_address_text', 'crm_address_text_test'); + $this->order->add_meta_data('crm_customer_comment', 'crm_customer_comment_test'); + $this->order->save(); - - $orderId = $this->order->get_id(); - - update_post_meta($orderId, 'woo_order', 'test_custom_fields'); - update_post_meta($orderId, 'crm_phone', '1111122222'); - update_post_meta($orderId, 'crm_address_text', 'crm_address_text_test'); - update_post_meta($orderId, 'crm_customer_comment', 'crm_customer_comment_test'); } private function getResponseData($externalId) diff --git a/tests/test-wc-retailcrm-uploader.php b/tests/test-wc-retailcrm-uploader.php index 11f631e..244090f 100644 --- a/tests/test-wc-retailcrm-uploader.php +++ b/tests/test-wc-retailcrm-uploader.php @@ -87,7 +87,7 @@ class WC_Retailcrm_Uploader_Test extends WC_Retailcrm_Test_Case_Helper public function test_order_upload($retailcrm) { $retailcrm_uploader = $this->getRetailcrmUploader($retailcrm); - $data = $retailcrm_uploader->uploadArchiveOrders(0); + $data = $retailcrm_uploader->uploadArchiveOrders(null); $this->assertEquals(null, $data); }