Правка тестов
This commit is contained in:
parent
a3d8271b1f
commit
b2611f7267
4 changed files with 60 additions and 6 deletions
4
Makefile
4
Makefile
|
@ -26,8 +26,8 @@ install_bitrix: download_bitrix
|
|||
download_bitrix:
|
||||
ifeq ("$(wildcard $(BITRIX_PATH)/bitrix/php_interface/dbconn.php)","")
|
||||
wget --progress=dot -e dotbytes=10M -O /tmp/$(BITRIX_EDITION).tar.gz https://www.1c-bitrix.ru/download/$(BITRIX_EDITION).tar.gz
|
||||
@mkdir -p $(BITRIX_PATH)
|
||||
@chmod -R 777 $(BITRIX_PATH)
|
||||
mkdir -p $(BITRIX_PATH)
|
||||
chmod -R 777 $(BITRIX_PATH)
|
||||
tar -xf /tmp/$(BITRIX_EDITION).tar.gz -C $(BITRIX_PATH)
|
||||
rm /tmp/$(BITRIX_EDITION).tar.gz
|
||||
endif
|
||||
|
|
|
@ -151,7 +151,7 @@ class RetailCrmEventTest extends PHPUnit\Framework\TestCase
|
|||
|
||||
$result = $this->retailcrmEvent->OrderDelete($event);
|
||||
|
||||
$this->assertEquals(null, $result);
|
||||
$this->assertEquals(true, $GLOBALS['RETAILCRM_ORDER_DELETE']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,11 +160,17 @@ class RetailCrmEventTest extends PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testOnUpdateOrder()
|
||||
{
|
||||
$arFields = [];
|
||||
$arFields = [
|
||||
'CANCELED' => 'Y',
|
||||
'BASKET_ITEMS' => [],
|
||||
'ORDER_PROP' => []
|
||||
];
|
||||
|
||||
$result = $this->retailcrmEvent->OnUpdateOrder(1, $arFields);
|
||||
|
||||
$this->assertEquals(null, $result);
|
||||
$this->assertEquals(true, $GLOBALS['RETAILCRM_ORDER_OLD_EVENT']);
|
||||
|
||||
$this->assertEquals(true, $GLOBALS['ORDER_DELETE_USER_ADMIN']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -113,7 +113,9 @@ class RetailCrmOrder_v5Test extends BitrixTestCase {
|
|||
],
|
||||
'payments' => [[
|
||||
'type' => $arParams['optionsPayTypes'][$arFields['PAYMENTS'][0]['PAY_SYSTEM_ID']],
|
||||
'externalId' => RCrmActions::generatePaymentExternalId($arFields['PAYMENTS'][0]['ID'])
|
||||
'externalId' => RCrmActions::generatePaymentExternalId($arFields['PAYMENTS'][0]['ID']),
|
||||
'status' => 'paid',
|
||||
'paidAt' => $this->getDateTime()->format('Y-m-d H:i:s')
|
||||
]],
|
||||
'privilegeType' => 'none'
|
||||
],
|
||||
|
|
|
@ -33,4 +33,50 @@ class RetailCrmServiceTest extends PHPUnit\Framework\TestCase
|
|||
|
||||
$this->assertEquals($newParams, $expectedArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $expected
|
||||
* @dataProvider selectIntegrationDeliveriesProvider
|
||||
*/
|
||||
public function testSelectIntegrationDeliveries(array $data, array $expected)
|
||||
{
|
||||
$this->assertEquals($expected, RetailCrmService::selectIntegrationDeliveries($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $expected
|
||||
* @dataProvider selectIntegrationPaymentsProvider
|
||||
*/
|
||||
public function testSelectIntegrationPayments(array $data, array $expected)
|
||||
{
|
||||
$this->assertEquals($expected, RetailCrmService::selectIntegrationPayments($data));
|
||||
}
|
||||
|
||||
public function selectIntegrationDeliveriesProvider()
|
||||
{
|
||||
return [[
|
||||
'data' => [
|
||||
[
|
||||
'code' => 'test1',
|
||||
'integrationCode' => 'test2'
|
||||
]
|
||||
],
|
||||
'expected' => ['test1' => 'test2']
|
||||
]];
|
||||
}
|
||||
|
||||
public function selectIntegrationPaymentsProvider()
|
||||
{
|
||||
return [[
|
||||
'data' => [
|
||||
[
|
||||
'code' => 'test1',
|
||||
'integrationModule' => 'test2'
|
||||
]
|
||||
],
|
||||
'expected' => ['test1']
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue