parent
775c5b972e
commit
ad7ed2056e
2 changed files with 17 additions and 2 deletions
|
@ -67,7 +67,12 @@ class RetailCrmHistory
|
|||
$matchedCustomFields = RetailcrmConfigProvider::getMatchedUserFields() ?? [];
|
||||
$matchedCustomFields = array_flip($matchedCustomFields);
|
||||
self::$CUSTOM_FIELDS_IS_ACTIVE = RetailcrmConfigProvider::getCustomFieldsStatus();
|
||||
$customUserFieldTypes = RCrmActions::getTypeUserField();
|
||||
|
||||
$customUserFieldTypes = [];
|
||||
|
||||
if (self::$CUSTOM_FIELDS_IS_ACTIVE === 'Y') {
|
||||
$customUserFieldTypes = RCrmActions::getTypeUserField();
|
||||
}
|
||||
|
||||
if ($historyStart && $historyStart > 0) {
|
||||
$historyFilter['sinceId'] = $historyStart;
|
||||
|
@ -279,7 +284,11 @@ class RetailCrmHistory
|
|||
|
||||
self::$CUSTOM_FIELDS_IS_ACTIVE = RetailcrmConfigProvider::getCustomFieldsStatus();
|
||||
|
||||
$customUserFieldTypes = RCrmActions::getTypeUserField();
|
||||
$customUserFieldTypes = [];
|
||||
|
||||
if (self::$CUSTOM_FIELDS_IS_ACTIVE === 'Y') {
|
||||
$customUserFieldTypes = RCrmActions::getTypeUserField();
|
||||
}
|
||||
|
||||
$api = new RetailCrm\ApiClient(RetailcrmConfigProvider::getApiUrl(), RetailcrmConfigProvider::getApiKey());
|
||||
$page = 1;
|
||||
|
|
|
@ -39,6 +39,10 @@ class RetailCrmHistory_v5Test extends \BitrixTestCase
|
|||
$apiResponse = new ApiResponse(200, DataHistory::get_history_data_new_customer());
|
||||
|
||||
$actionsMock->shouldReceive('apiMethod')->withAnyArgs()->andReturn($apiResponse);
|
||||
$actionsMock->shouldReceive('getTypeUserField')->withAnyArgs()->andReturn([
|
||||
'UF_FIELD_USER_1' => 'string', 'UF_FIELD_USER_2' => 'string'
|
||||
]);
|
||||
$actionsMock->shouldReceive('convertCrmValueToFieldUser')->byDefault();
|
||||
|
||||
$this->deleteTestingUser();
|
||||
RetailCrmHistory::customerHistory();
|
||||
|
@ -46,6 +50,8 @@ class RetailCrmHistory_v5Test extends \BitrixTestCase
|
|||
$dbUser = CUser::GetList(($by = 'ID'), ($sort = 'DESC'), ['=EMAIL' => 'testbitrixreg@gmail.com']);
|
||||
|
||||
$this->assertEquals(1, $dbUser->SelectedRowsCount());
|
||||
|
||||
RetailcrmConfigProvider::setCustomFieldsStatus('N');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue