From 790831e9338405f539a6d04d2ffc4d7a97bd1730 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Wed, 24 Nov 2021 18:45:01 +0800 Subject: [PATCH] `MoneyTransferOperator` => `ReceivePaymentsOperator` --- ...erator.php => ReceivePaymentsOperator.php} | 6 ++-- ...st.php => ReceivePaymentsOperatorTest.php} | 36 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) rename src/Entities/{MoneyTransferOperator.php => ReceivePaymentsOperator.php} (89%) rename tests/AtolOnline/Tests/Entities/{MoneyTransferOperatorTest.php => ReceivePaymentsOperatorTest.php} (65%) diff --git a/src/Entities/MoneyTransferOperator.php b/src/Entities/ReceivePaymentsOperator.php similarity index 89% rename from src/Entities/MoneyTransferOperator.php rename to src/Entities/ReceivePaymentsOperator.php index ddddf66..06b0414 100644 --- a/src/Entities/MoneyTransferOperator.php +++ b/src/Entities/ReceivePaymentsOperator.php @@ -20,17 +20,17 @@ use Illuminate\Support\Collection; * * @see https://online.atol.ru/files/API_atol_online_v4.pdf Документация, стр 19-20 */ -class MoneyTransferOperator extends Entity +class ReceivePaymentsOperator extends Entity { /** - * @var Collection Телефоны платёжного агента (1073) + * @var Collection Телефоны оператора по приёму платежей (1074) */ protected Collection $phones; /** * Конструктор * - * @param array|Collection|null $phones Телефон оператора по приёму платежей (1074) + * @param array|Collection|null $phones Телефоны оператора по приёму платежей (1074) * @throws InvalidPhoneException */ public function __construct( diff --git a/tests/AtolOnline/Tests/Entities/MoneyTransferOperatorTest.php b/tests/AtolOnline/Tests/Entities/ReceivePaymentsOperatorTest.php similarity index 65% rename from tests/AtolOnline/Tests/Entities/MoneyTransferOperatorTest.php rename to tests/AtolOnline/Tests/Entities/ReceivePaymentsOperatorTest.php index 45b8800..ffe501e 100644 --- a/tests/AtolOnline/Tests/Entities/MoneyTransferOperatorTest.php +++ b/tests/AtolOnline/Tests/Entities/ReceivePaymentsOperatorTest.php @@ -10,38 +10,38 @@ namespace AtolOnline\Tests\Entities; use AtolOnline\{ - Entities\MoneyTransferOperator, + Entities\ReceivePaymentsOperator, Exceptions\InvalidPhoneException, Tests\BasicTestCase}; /** * Набор тестов для проверки работы класса оператора по приёму платежей */ -class MoneyTransferOperatorTest extends BasicTestCase +class ReceivePaymentsOperatorTest extends BasicTestCase { /** * Тестирует конструктор без передачи значений и корректное приведение к json * - * @covers \AtolOnline\Entities\MoneyTransferOperator - * @covers \AtolOnline\Entities\MoneyTransferOperator::jsonSerialize + * @covers \AtolOnline\Entities\ReceivePaymentsOperator + * @covers \AtolOnline\Entities\ReceivePaymentsOperator::jsonSerialize */ public function testConstructorWithoutArgs(): void { - $this->assertEquals('[]', (string)(new MoneyTransferOperator())); + $this->assertEquals('[]', (string)(new ReceivePaymentsOperator())); } /** * Тестирует конструктор с передачей значений и корректное приведение к json * - * @covers \AtolOnline\Entities\MoneyTransferOperator - * @covers \AtolOnline\Entities\MoneyTransferOperator::jsonSerialize - * @covers \AtolOnline\Entities\MoneyTransferOperator::setPhones - * @covers \AtolOnline\Entities\MoneyTransferOperator::getPhones + * @covers \AtolOnline\Entities\ReceivePaymentsOperator + * @covers \AtolOnline\Entities\ReceivePaymentsOperator::jsonSerialize + * @covers \AtolOnline\Entities\ReceivePaymentsOperator::setPhones + * @covers \AtolOnline\Entities\ReceivePaymentsOperator::getPhones * @throws InvalidPhoneException */ public function testConstructorWithArgs(): void { - $this->assertAtolable(new MoneyTransferOperator(['+122997365456']), ['phones' => ['+122997365456']]); + $this->assertAtolable(new ReceivePaymentsOperator(['+122997365456']), ['phones' => ['+122997365456']]); } /** @@ -62,14 +62,14 @@ class MoneyTransferOperatorTest extends BasicTestCase * Тестирует установку пустых телефонов * * @dataProvider providerNullablePhonesArrays - * @covers \AtolOnline\Entities\MoneyTransferOperator - * @covers \AtolOnline\Entities\MoneyTransferOperator::setPhones - * @covers \AtolOnline\Entities\MoneyTransferOperator::getPhones + * @covers \AtolOnline\Entities\ReceivePaymentsOperator + * @covers \AtolOnline\Entities\ReceivePaymentsOperator::setPhones + * @covers \AtolOnline\Entities\ReceivePaymentsOperator::getPhones * @throws InvalidPhoneException */ public function testNullablePhones(mixed $phones): void { - $agent = new MoneyTransferOperator($phones); + $agent = new ReceivePaymentsOperator($phones); $this->assertIsCollection($agent->getPhones()); $this->assertTrue($agent->getPhones()->isEmpty()); } @@ -77,19 +77,19 @@ class MoneyTransferOperatorTest extends BasicTestCase /** * Тестирует установку невалидных телефонов * - * @covers \AtolOnline\Entities\MoneyTransferOperator - * @covers \AtolOnline\Entities\MoneyTransferOperator::setPhones + * @covers \AtolOnline\Entities\ReceivePaymentsOperator + * @covers \AtolOnline\Entities\ReceivePaymentsOperator::setPhones * @covers \AtolOnline\Exceptions\InvalidPhoneException * @throws InvalidPhoneException */ public function testInvalidPhoneException(): void { $this->expectException(InvalidPhoneException::class); - (new MoneyTransferOperator())->setPhones([ + (new ReceivePaymentsOperator([ '12345678901234567', // good '+123456789012345678', // good '12345678901234567890', // bad '+12345678901234567890', // bad - ]); + ])); } }