* Dariusz Rumiński * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Console\Report\ListSetsReport; use PhpCsFixer\Console\Report\ListSetsReport\JsonReporter; use PhpCsFixer\Console\Report\ListSetsReport\ReporterInterface; use PhpCsFixer\Tests\Test\Assert\AssertJsonSchemaTrait; /** * @author Dariusz Rumiński * * @internal * * @covers \PhpCsFixer\Console\Report\ListSetsReport\JsonReporter */ final class JsonReporterTest extends AbstractReporterTestCase { use AssertJsonSchemaTrait; protected function createReporter(): ReporterInterface { return new JsonReporter(); } protected function getFormat(): string { return 'json'; } protected function assertFormat(string $expected, string $input): void { self::assertJsonSchema(__DIR__.'/../../../../doc/schemas/list-sets/schema.json', $input); self::assertJsonStringEqualsJsonString($expected, $input); } protected static function createSimpleReport(): string { return '{ "sets": { "@PhpCsFixer": { "description": "Rule set as used by the PHP-CS-Fixer development team, highly opinionated.", "isRisky": false, "name": "@PhpCsFixer" }, "@Symfony:risky": { "description": "Rules that follow the official `Symfony Coding Standards `_.", "isRisky": true, "name": "@Symfony:risky" } } }'; } }