1
0
mirror of synced 2024-11-22 21:36:10 +03:00
bitrix-module/tests/classes/general/services/RetailCrmServiceTest.php
2020-09-28 13:02:03 +03:00

37 lines
1.0 KiB
PHP

<?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);
}
}