1
0
mirror of synced 2024-11-25 14:56:09 +03:00
bitrix-module/tests/classes/general/services/RetailCrmServiceTest.php

63 lines
1.9 KiB
PHP

<?php
/**
* Class RetailCrmServiceTest
*/
class RetailCrmServiceTest extends PHPUnit\Framework\TestCase
{
private $paramsExample = array (
'number' => '5958C',
'externalId' => '8',
'createdAt' => '2020-06-22 16:47:49',
'customer' => array (
'externalId' => '3',
),
'orderType' => 'eshop-individual',
'status' => 'prepayed',
'delivery' => array (
'cost' => '0',
'address' => array (
'text' => 'ул. Первомайская 41',
),
'code' => 'boxberry',
),
'contragent' => array (
'contragentType' => 'individual',
),
'discountManualAmount' => '0',
'discountManualPercent' => '0',
'items' => array (
array (
'externalIds' => array (
array (
'code' => 'bitrix',
'value' => '0_88',
),
),
'quantity' => '1',
'offer' => array (
'externalId' => '88',
'xmlId' => '248',
),
'productName' => 'Agustí Torelló Mata GR Barrica 2011',
'id' => '9072',
'discountManualPercent' => '0',
'discountManualAmount' => '0',
'initialPrice' => '21.25',
),
),
);
public function testOnUnsetIntegrationDeliveryFields()
{
$newParams = RetailCrmService::unsetIntegrationDeliveryFields($this->paramsExample);
$expectedArray = $this->paramsExample;
unset($expectedArray['firstName']);
unset($expectedArray['lastName']);
unset($expectedArray['delivery']['address']);
unset($expectedArray['delivery']['cost']);
$this->assertEquals($newParams, $expectedArray);
}
}