@@ -35,8 +35,9 @@ public function testInvalidCases(string $input, string $schema, ?int $checkMode
3535 $ checkMode |= Constraint::CHECK_MODE_VALIDATE_SCHEMA ;
3636 }
3737
38- $ schemaStorage = new SchemaStorage ($ this ->getUriRetrieverMock (json_decode ($ schema , false )));
39- $ schema = $ schemaStorage ->getSchema ('http://www.my-domain.com/schema.json ' );
38+ $ schema = json_decode ($ schema , false );
39+ $ schemaStorage = new SchemaStorage ($ this ->getUriRetrieverMock ($ schema ));
40+ $ schema = $ schemaStorage ->getSchema ($ schema ->id ?? 'http://www.my-domain.com/schema.json ' );
4041 if (is_object ($ schema ) && !isset ($ schema ->{'$schema ' })) {
4142 $ schema ->{'$schema ' } = $ this ->schemaSpec ;
4243 }
@@ -67,8 +68,9 @@ public function testInvalidCasesUsingAssoc($input, $schema, $checkMode = Constra
6768 $ this ->markTestSkipped ('Test indicates that it is not for "CHECK_MODE_TYPE_CAST" ' );
6869 }
6970
70- $ schemaStorage = new SchemaStorage ($ this ->getUriRetrieverMock (json_decode ($ schema )));
71- $ schema = $ schemaStorage ->getSchema ('http://www.my-domain.com/schema.json ' );
71+ $ schema = json_decode ($ schema , false );
72+ $ schemaStorage = new SchemaStorage ($ this ->getUriRetrieverMock ($ schema ));
73+ $ schema = $ schemaStorage ->getSchema ($ schema ->id ?? 'http://www.my-domain.com/schema.json ' );
7274 if (is_object ($ schema ) && !isset ($ schema ->{'$schema ' })) {
7375 $ schema ->{'$schema ' } = $ this ->schemaSpec ;
7476 }
@@ -94,8 +96,10 @@ public function testValidCases($input, $schema, $checkMode = Constraint::CHECK_M
9496 if ($ this ->validateSchema ) {
9597 $ checkMode |= Constraint::CHECK_MODE_VALIDATE_SCHEMA ;
9698 }
97- $ schemaStorage = new SchemaStorage ($ this ->getUriRetrieverMock (json_decode ($ schema )));
98- $ schema = $ schemaStorage ->getSchema ('http://www.my-domain.com/schema.json ' );
99+
100+ $ schema = json_decode ($ schema , false );
101+ $ schemaStorage = new SchemaStorage ($ this ->getUriRetrieverMock ($ schema ));
102+ $ schema = $ schemaStorage ->getSchema ($ schema ->id ?? 'http://www.my-domain.com/schema.json ' );
99103 if (is_object ($ schema ) && !isset ($ schema ->{'$schema ' })) {
100104 $ schema ->{'$schema ' } = $ this ->schemaSpec ;
101105 }
@@ -120,9 +124,9 @@ public function testValidCasesUsingAssoc($input, $schema, $checkMode = Constrain
120124 $ this ->markTestSkipped ('Test indicates that it is not for "CHECK_MODE_TYPE_CAST" ' );
121125 }
122126
123- $ schema = json_decode ($ schema );
127+ $ schema = json_decode ($ schema, false );
124128 $ schemaStorage = new SchemaStorage ($ this ->getUriRetrieverMock ($ schema ), new UriResolver ());
125- $ schema = $ schemaStorage ->getSchema ('http://www.my-domain.com/schema.json ' );
129+ $ schema = $ schemaStorage ->getSchema ($ schema -> id ?? + 'http://www.my-domain.com/schema.json ' );
126130 if (is_object ($ schema ) && !isset ($ schema ->{'$schema ' })) {
127131 $ schema ->{'$schema ' } = $ this ->schemaSpec ;
128132 }
0 commit comments