File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
tests/JsonSchema/Tests/Uri Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 99
1010namespace JsonSchema \Tests \Uri ;
1111
12+ use JsonSchema \Exception \JsonDecodingException ;
1213use JsonSchema \Validator ;
1314
1415class UriRetrieverTest extends \PHPUnit_Framework_TestCase
@@ -22,12 +23,19 @@ protected function setUp()
2223
2324 private function getRetrieverMock ($ returnSchema , $ returnMediaType = Validator::SCHEMA_MEDIA_TYPE )
2425 {
26+
27+ $ jsonSchema = json_decode ($ returnSchema );
28+
29+ if (JSON_ERROR_NONE < $ error = json_last_error ()) {
30+ throw new JsonDecodingException ($ error );
31+ }
32+
2533 $ retriever = $ this ->getMock ('JsonSchema\Uri\UriRetriever ' , array ('retrieve ' ));
2634
2735 $ retriever ->expects ($ this ->at (0 ))
2836 ->method ('retrieve ' )
2937 ->with ($ this ->equalTo (null ), $ this ->equalTo ('http://some.host.at/somewhere/parent ' ))
30- ->will ($ this ->returnValue ($ returnSchema ));
38+ ->will ($ this ->returnValue ($ jsonSchema ));
3139
3240 return $ retriever ;
3341 }
You can’t perform that action at this time.
0 commit comments