Skip to content

Commit

Permalink
fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Oct 7, 2024
1 parent 1ae1e62 commit 7e92f54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/unit/Formatter/JsonFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
use Roave\BackwardCompatibility\Changes;
use Roave\BackwardCompatibility\Formatter\JsonFormatter;
use Roave\BackwardCompatibility\Git\CheckedOutRepository;
use stdClass;
use Symfony\Component\Console\Output\BufferedOutput;

use function dirname;
use function json_decode;

use const JSON_THROW_ON_ERROR;

/** @covers \Roave\BackwardCompatibility\Formatter\JsonFormatter */
final class JsonFormatterTest extends TestCase
{
Expand Down Expand Up @@ -76,7 +79,9 @@ public function testWrite(): void
self::assertIsArray($data);
self::assertEquals($expected, $data);

JsonAssert::assertJsonMatchesSchema($json, dirname(__DIR__, 3) . '/Resources/errors.schema.json');
$content = json_decode($json, flags: JSON_THROW_ON_ERROR);
self::assertInstanceOf(stdClass::class, $content);
JsonAssert::assertJsonMatchesSchema($content, dirname(__DIR__, 3) . '/Resources/errors.schema.json');

self::assertJsonStringEqualsJsonString(
<<<'OUTPUT'
Expand Down

0 comments on commit 7e92f54

Please sign in to comment.