mirror of
https://git.yoomoney.ru/scm/sdk/yookassa-sdk-php.git
synced 2026-08-26 04:28:19 +00:00
Добавлено поле refund_method в возвратах. Добавлено поле sbp_operation_id в PaymentMethodSbp
Добавлено поле `merchant_customer_bank_account` в объекте `FraudData` Добавлен статус самозанятого `unregistered` Добавлен список провайдеров онлайн-касс `FiscalizationProvider` Добавлен объект Me с подобъектом `Fiscalization`
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\YooKassa\Model\Refund\RefundMethod;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use YooKassa\Helpers\Random;
|
||||
use YooKassa\Model\Refund\RefundMethod\AbstractRefundMethod;
|
||||
|
||||
abstract class AbstractTestRefundMethod extends TestCase
|
||||
{
|
||||
public function testGetType(): void
|
||||
{
|
||||
$instance = $this->getTestInstance();
|
||||
self::assertEquals($this->getExpectedType(), $instance->getType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider invalidTypeDataProvider
|
||||
*/
|
||||
public function testInvalidType(mixed $value): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
new TestRefundData($value);
|
||||
}
|
||||
|
||||
public static function invalidTypeDataProvider()
|
||||
{
|
||||
return [
|
||||
[''],
|
||||
[null],
|
||||
[Random::str(40)],
|
||||
[0],
|
||||
];
|
||||
}
|
||||
|
||||
abstract protected function getTestInstance(): AbstractRefundMethod;
|
||||
|
||||
abstract protected function getExpectedType(): string;
|
||||
}
|
||||
|
||||
class TestRefundData extends AbstractRefundMethod
|
||||
{
|
||||
public function __construct($type)
|
||||
{
|
||||
parent::__construct([]);
|
||||
$this->setType($type);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user