2019-02-28 14:45:39 +03:00
|
|
|
<?php
|
2022-03-02 15:40:53 +03:00
|
|
|
|
2019-02-28 14:45:39 +03:00
|
|
|
/**
|
|
|
|
* PHP version 7.0
|
|
|
|
*
|
|
|
|
* @category Integration
|
|
|
|
*/
|
|
|
|
|
2022-03-02 15:40:53 +03:00
|
|
|
if (file_exists(__DIR__ . '/../vendor/RetailcrmClasspathBuilder.php')) {
|
|
|
|
require_once __DIR__ . '/../vendor/RetailcrmClasspathBuilder.php';
|
2019-02-28 15:42:04 +03:00
|
|
|
}
|
2019-02-28 14:45:39 +03:00
|
|
|
|
2020-03-23 15:12:07 +03:00
|
|
|
if (file_exists(__DIR__ . '/../.env')) {
|
|
|
|
$dotenv = Dotenv\Dotenv::create(__DIR__ . '/../');
|
|
|
|
$dotenv->load();
|
2019-02-28 15:11:49 +03:00
|
|
|
}
|
2019-02-28 14:45:39 +03:00
|
|
|
|
2020-03-23 15:12:07 +03:00
|
|
|
$_SERVER['DOCUMENT_ROOT'] = getenv('BITRIX_PATH') ? getenv('BITRIX_PATH') : '/var/www/html';
|
|
|
|
|
2019-02-28 14:45:39 +03:00
|
|
|
define('NOT_CHECK_PERMISSIONS', true);
|
|
|
|
define('NO_AGENT_CHECK', true);
|
|
|
|
|
|
|
|
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
|
|
|
|
|
|
|
|
global $USER;
|
|
|
|
$USER->Authorize(1);
|
|
|
|
|
2022-07-20 12:46:32 +03:00
|
|
|
$retailcrmModuleId = 'intaro.retailcrm';
|
|
|
|
|
|
|
|
if (!IsModuleInstalled($retailcrmModuleId)) {
|
|
|
|
RegisterModule($retailcrmModuleId);
|
2019-02-28 14:45:39 +03:00
|
|
|
}
|
2020-03-23 15:12:07 +03:00
|
|
|
|
2022-07-20 12:46:32 +03:00
|
|
|
COption::SetOptionString($retailcrmModuleId, 'api_host', 'https://test.retailcrm.ru');
|
|
|
|
COption::SetOptionString($retailcrmModuleId, 'api_key', 'nvwhebvwevboihbwvoijn');
|
|
|
|
COption::SetOptionString($retailcrmModuleId, 'api_version', 'v5');
|
|
|
|
CModule::IncludeModule($retailcrmModuleId);
|
2020-09-25 12:31:45 +03:00
|
|
|
|
2021-01-13 15:45:46 +03:00
|
|
|
CModule::IncludeModule("main");
|
|
|
|
global $DB;
|
|
|
|
$strSql = "INSERT INTO b_file (TIMESTAMP_X, MODULE_ID, HEIGHT, WIDTH, FILE_SIZE, CONTENT_TYPE, SUBDIR, FILE_NAME, ORIGINAL_NAME, DESCRIPTION, HANDLER_ID, EXTERNAL_ID)
|
|
|
|
VALUES ('2020-05-08 19:04:03', 'iblock', '500', '500', '23791', 'image/jpeg', 'iblock/c44', 'test.jpg', '788c4cf58bd93a5f75f2e3f2034023db.jpg', '', '', 'c570f175b3f74ccfa62c4a10d8e44b5c');";
|
|
|
|
$DB->Query($strSql);
|
|
|
|
|
2022-03-02 15:40:53 +03:00
|
|
|
require_once __DIR__ . '/BitrixTestCase.php';
|
|
|
|
require_once __DIR__ . '/helpers/Helpers.php';
|