Files
HRM-System/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidPropertyExceptionTest.php
2026-04-13 08:19:53 +08:00

39 lines
918 B
PHP

<?php
namespace Tests\YooKassa\Common\Exceptions;
use PHPUnit\Framework\TestCase;
use YooKassa\Common\Exceptions\InvalidPropertyException;
use YooKassa\Helpers\StringObject;
/**
* @internal
*/
class InvalidPropertyExceptionTest extends TestCase
{
/**
* @dataProvider validPropertyDataProvider
*
* @param mixed $property
*/
public function testGetProperty($property): void
{
$instance = $this->getTestInstance('', $property);
self::assertEquals((string) $property, $instance->getProperty());
}
public static function validPropertyDataProvider()
{
return [
[''],
['property'],
[new StringObject('property')],
];
}
protected function getTestInstance(string $message, string $property): InvalidPropertyException
{
return new InvalidPropertyException($message, 0, $property);
}
}