1
0
mirror of https://github.com/halaxa/json-machine.git synced 2025-07-16 12:06:23 +02:00
Files
json-machine/test/JsonMachineTest/JsonDecoder/DecodingErrorTest.php
2023-11-26 22:07:06 +01:00

29 lines
659 B
PHP

<?php
declare(strict_types=1);
namespace JsonMachineTest\JsonDecoder;
use JsonMachine\JsonDecoder\DecodingError;
use PHPUnit\Framework\TestCase;
/**
* @covers \JsonMachine\JsonDecoder\DecodingError
*/
class DecodingErrorTest extends TestCase
{
public function testGetMalformedJson()
{
$decodingError = new DecodingError('"json\"', '');
$this->assertSame('"json\"', $decodingError->getMalformedJson());
}
public function testGetErrorMessage()
{
$decodingError = new DecodingError('', 'something bad happened');
$this->assertSame('something bad happened', $decodingError->getErrorMessage());
}
}