mirror of
https://github.com/halaxa/json-machine.git
synced 2025-07-16 12:06:23 +02:00
29 lines
659 B
PHP
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());
|
|
}
|
|
}
|