1
0
mirror of synced 2024-12-01 17:56:07 +03:00
bitrix-module/tests/BitrixTestCase.php
Neur0toxine 5f69051859
Программа лояльности
* 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>
2021-11-16 10:48:26 +03:00

71 lines
1.9 KiB
PHP
Executable File

<?php
/**
* Class BitrixTestCase
*/
class BitrixTestCase extends \PHPUnit\Framework\TestCase
{
/**
* @var bool
*/
protected $backupGlobals = false;
/**
* @var \Generator
*/
protected $faker;
/**
* этот метод phpUnit вызывает перед запуском текущего теста
* @inheritdoc
*/
public function setUp()
{
// создание экземпляра Faker, который будет создавать рандомные данные
$this->faker = \Faker\Factory::create();
}
/**
* этот метод phpUnit вызывает после исполнения текущего теста
* @inheritdoc
*/
public function tearDown()
{
// без этого вызова Mockery не будет работать
\Mockery::close();
}
public function getArFields(): array
{
return [
'ID' => 1,
'NUMBER' => "1",
'USER_ID' => "1",
'STATUS_ID' => "1",
'PERSON_TYPE_ID' => 'bitrixType',
'DATE_INSERT' => '2015-02-22 00:00:00',
'USER_DESCRIPTION' => 'userComment',
'COMMENTS' => 'managerComment',
'PRICE_DELIVERY' => '100',
'PROPS' => ['properties' => []],
'DELIVERYS' => [[
'id' => 'test',
'service' => 'service'
]],
'BASKET' => [],
'PAYMENTS' => [[
'ID' => 1,
'PAY_SYSTEM_ID' => 1,
'SUM' => 1000,
'DATE_PAID' => $this->getDateTime(),
'PAID' => 'Y'
]]
];
}
public function getDateTime(): \Bitrix\Main\Type\DateTime
{
return \Bitrix\Main\Type\DateTime::createFromPhp(new DateTime('2000-01-01'));
}
}