mirror of
https://git.yoomoney.ru/scm/sdk/yookassa-sdk-php.git
synced 2026-08-24 07:38:10 +00:00
cbcdbc8ae1
Отказ от поддержки PHP < 8 Изменена структура файлов Переработана логика работы с моделями Добавлено использование валидатора данных в моделях Массивы объектов заменены на объекты-коллекции
40 lines
951 B
PHP
40 lines
951 B
PHP
<?php
|
|
|
|
namespace Tests\YooKassa\Common\Exceptions;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use YooKassa\Common\Exceptions\ExtensionNotFoundException;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class ExtensionNotFoundExceptionTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider messageDataProvider
|
|
*
|
|
* @param mixed $name
|
|
* @param mixed $excepted
|
|
*/
|
|
public function testGetMessage($name, $excepted): void
|
|
{
|
|
$instance = $this->getTestInstance($name);
|
|
|
|
self::assertEquals($excepted, $instance->getMessage());
|
|
}
|
|
|
|
public static function messageDataProvider()
|
|
{
|
|
return [
|
|
['json', 'json extension is not loaded!'],
|
|
['curl', 'curl extension is not loaded!'],
|
|
['gd', 'gd extension is not loaded!'],
|
|
];
|
|
}
|
|
|
|
protected function getTestInstance(string $name, int $code = 0): ExtensionNotFoundException
|
|
{
|
|
return new ExtensionNotFoundException($name, $code);
|
|
}
|
|
}
|