From 233f78e221ba8a328d395b114abe3465ec278c4d Mon Sep 17 00:00:00 2001 From: Uryvskiy Dima Date: Mon, 24 Apr 2023 14:33:47 +0300 Subject: [PATCH] Fix the mistake with test name --- tests/lib/RetailcrmHistoryTest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/lib/RetailcrmHistoryTest.php b/tests/lib/RetailcrmHistoryTest.php index 830fd83..2578b03 100644 --- a/tests/lib/RetailcrmHistoryTest.php +++ b/tests/lib/RetailcrmHistoryTest.php @@ -196,7 +196,7 @@ class RetailcrmHistoryTest extends RetailcrmTestCase $this->assertEquals($updReference, $secondUpdOrder->reference); } - public function tetsLastSinceId() + public function testLastSinceId() { RetailcrmHistory::$default_lang = (int) Configuration::get('PS_LANG_DEFAULT'); RetailcrmHistory::$api = $this->apiMock; @@ -206,13 +206,21 @@ class RetailcrmHistoryTest extends RetailcrmTestCase ->willReturn(new RetailcrmApiResponse('200', json_encode($this->getLastSinceId()))) ; + $this->apiClientMock->expects($this->any()) + ->method('customersHistory') + ->willReturn(new RetailcrmApiResponse('200', json_encode($this->getLastSinceId()))) + ; + $lastSinceId = 0; + Configuration::updateValue('RETAILCRM_LAST_ORDERS_SYNC', $lastSinceId); + Configuration::updateValue('RETAILCRM_LAST_CUSTOMERS_SYNC', $lastSinceId); - $isUpdate = RetailcrmHistory::updateSinceId('orders'); - - $this->assertTrue($isUpdate); + $this->assertTrue(RetailcrmHistory::updateSinceId('orders')); + $this->assertTrue(RetailcrmHistory::updateSinceId('customers')); $this->assertNotEquals($lastSinceId, Configuration::get('RETAILCRM_LAST_ORDERS_SYNC')); + $this->assertNotEquals($lastSinceId, Configuration::get('RETAILCRM_LAST_CUSTOMERS_SYNC')); + $this->assertFalse(RetailcrmHistory::updateSinceId('test_test')); } public function orderCreateDataProvider()