* New module structure (refactoring) * Simple serializer and deserializer with models, new architecture * Move logic to strategies * Partial api client facade implementation (full implementation is not necessary for now) * Loyalty feature installer * Sms verification order (#167) * Make updater self-sufficient * Fix for order submit & fix for incorrect component rendering in the constructor * Fix for loyalty personal area error handling * Fix for cart component identity * Fix for softlock when customer cannot be registered in loyalty Co-authored-by: Сергей Чазов <45812598+Chazovs@users.noreply.github.com> Co-authored-by: Sergey Chazov <oitv18@gmail.com>
37 lines
1.0 KiB
PHP
Executable File
37 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* Class RetailCrmServiceTest
|
|
*/
|
|
class RetailCrmServiceTest extends PHPUnit\Framework\TestCase
|
|
{
|
|
private $paramsExample = [
|
|
'delivery' => [
|
|
'code' => 'boxberry',
|
|
'cost' => 'test',
|
|
'address' => 'test',
|
|
'data' => 'test',
|
|
],
|
|
'weight' => 'test',
|
|
'firstName' => 'test',
|
|
'lastName' => 'test',
|
|
'phone' => 'test',
|
|
'paymentType' => 'test',
|
|
'shipmentStore' => 'test',
|
|
];
|
|
|
|
public function testOnUnsetIntegrationDeliveryFields()
|
|
{
|
|
$value = serialize(['boxberry' => 'test']);
|
|
COption::SetOptionString(RetailcrmConstants::MODULE_ID, RetailcrmConstants::CRM_INTEGRATION_DELIVERY, $value);
|
|
$newParams = RetailCrmService::unsetIntegrationDeliveryFields($this->paramsExample);
|
|
$expectedArray = [
|
|
'delivery' => [
|
|
'code' => 'boxberry',
|
|
],
|
|
];
|
|
|
|
$this->assertEquals($newParams, $expectedArray);
|
|
}
|
|
}
|