Skip to content

Commit cd35373

Browse files
committed
test: improve test
1 parent c638641 commit cd35373

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/JsonSchemaTestSuite.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testIt(
2424
): void
2525
{
2626
$schemaStorage = new SchemaStorage();
27-
$schemaStorage->addSchema('internal://mySchema', $schema);
27+
$schemaStorage->addSchema(property_exists($schema, 'id') ? $schema->id : SchemaStorage::INTERNAL_PROVIDED_SCHEMA_URI, $schema);
2828
$this->loadRemotesIntoStorage($schemaStorage);
2929
$validator = new Validator(new Factory($schemaStorage));
3030

@@ -36,7 +36,9 @@ public function testIt(
3636
public function casesDataProvider(): \Generator
3737
{
3838
$testDir = __DIR__ . '/../vendor/json-schema/json-schema-test-suite/tests';
39-
$drafts = array_filter(glob($testDir . '/*'), is_dir(...));
39+
$drafts = array_filter(glob($testDir . '/*'), static function (string $filename) {
40+
return is_dir($filename);
41+
});
4042
$skippedDrafts = ['draft4', 'draft6', 'draft7', 'draft2019-09', 'draft2020-12', 'draft-next', 'latest'];
4143

4244
foreach ($drafts as $draft) {

0 commit comments

Comments
 (0)