Skip to content

Commit

Permalink
test: make sure the structures we parse match the original documents
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed May 7, 2023
1 parent 7240708 commit 4dee1af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/ParseCanonicalSchemasTest.php
Expand Up @@ -14,6 +14,7 @@
use function array_reduce;
use function assert;
use function is_string;
use function json_encode;
use function realpath;

use const PHP_EOL;
Expand Down Expand Up @@ -59,7 +60,11 @@ public function testParsingCanonicalSchemas(): void
$document = $parser->parse($file->getContents());
$schemaFile = $schemaRepository->findSchemaPathByNsid($document->id);

// Make sure our NSID parsing is correct.
$this->assertSame($file->getRealPath(), $schemaFile);

// Make sure the structure we created matches the original document.
$this->assertJsonStringEqualsJsonString($file->getContents(), (string) json_encode($document));
} catch (LexiconException $exception) {
$failedSchemas[] = [
'file' => $file->getRealPath(),
Expand Down

0 comments on commit 4dee1af

Please sign in to comment.