parent
25b4a17e40
commit
e003b63f2f
@ -1,3 +1,6 @@
|
||||
## 2023-08-22 v.6.4.1
|
||||
- Исправлена передача даты регистрации клиента
|
||||
|
||||
## 2023-08-22 v.6.4.0
|
||||
- Добавлена функция подписки на рекламно-информационные рассылки
|
||||
|
||||
|
@ -1 +1 @@
|
||||
- Добавлена функция подписки на рекламно-информационные рассылки
|
||||
- Исправлена передача даты регистрации клиента
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$arModuleVersion = [
|
||||
'VERSION' => '6.4.0',
|
||||
'VERSION_DATE' => '2023-08-22 13:00:00'
|
||||
'VERSION' => '6.4.1',
|
||||
'VERSION_DATE' => '2023-08-22 9:30:00'
|
||||
];
|
||||
|
@ -68,7 +68,7 @@ class User extends AbstractSerializableModel
|
||||
/**
|
||||
* @var \DateTime|null
|
||||
*
|
||||
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
|
||||
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
|
||||
* @Mapping\SerializedName("DATE_REGISTER")
|
||||
*/
|
||||
private $dateRegister;
|
||||
@ -85,7 +85,7 @@ class User extends AbstractSerializableModel
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
|
||||
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
|
||||
* @Mapping\SerializedName("LAST_LOGIN")
|
||||
*/
|
||||
private $lastLogin;
|
||||
@ -102,7 +102,7 @@ class User extends AbstractSerializableModel
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
|
||||
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
|
||||
* @Mapping\SerializedName("LAST_ACTIVITY_DATE")
|
||||
*/
|
||||
private $lastActivityDate;
|
||||
@ -110,7 +110,7 @@ class User extends AbstractSerializableModel
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
|
||||
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
|
||||
* @Mapping\SerializedName("TIMESTAMP_X")
|
||||
*/
|
||||
private $timestampX;
|
||||
|
41
tests/lib/service/CustomerServiceTest.php
Normal file
41
tests/lib/service/CustomerServiceTest.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Intaro\RetailCrm\Service\CustomerService;
|
||||
|
||||
/**
|
||||
* Class CustomerService
|
||||
*/
|
||||
class CustomerServiceTest extends BitrixTestCase
|
||||
{
|
||||
private $customerService;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
COption::SetOptionString('intaro.retailcrm', 'api_version', 'v5');
|
||||
CModule::IncludeModule('intaro.retailcrm');
|
||||
|
||||
$this->customerService = new CustomerService();
|
||||
}
|
||||
|
||||
public function testCreateModel()
|
||||
{
|
||||
$user = new CUser;
|
||||
$arUser = $user->Register(
|
||||
'TestLogin',
|
||||
'TestName',
|
||||
'TestLastName',
|
||||
'TestPassword',
|
||||
'TestPassword',
|
||||
'testemail@gmail.com'
|
||||
);
|
||||
|
||||
$customer = $this->customerService->createModel($arUser['ID']);
|
||||
$fields = CUser::GetByID($arUser['ID'])->Fetch();
|
||||
$dateRegister = new DateTimeImmutable($fields['DATE_REGISTER']);
|
||||
|
||||
self::assertEquals($dateRegister->getTimestamp(), $customer->createdAt->getTimestamp());
|
||||
CUser::Delete($arUser['ID']);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user