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 9
9
10
10
namespace JsonSchema \Tests \Uri ;
11
11
12
+ use JsonSchema \Exception \JsonDecodingException ;
12
13
use JsonSchema \Validator ;
13
14
14
15
class UriRetrieverTest extends \PHPUnit_Framework_TestCase
@@ -22,12 +23,19 @@ protected function setUp()
22
23
23
24
private function getRetrieverMock ($ returnSchema , $ returnMediaType = Validator::SCHEMA_MEDIA_TYPE )
24
25
{
26
+
27
+ $ jsonSchema = json_decode ($ returnSchema );
28
+
29
+ if (JSON_ERROR_NONE < $ error = json_last_error ()) {
30
+ throw new JsonDecodingException ($ error );
31
+ }
32
+
25
33
$ retriever = $ this ->getMock ('JsonSchema\Uri\UriRetriever ' , array ('retrieve ' ));
26
34
27
35
$ retriever ->expects ($ this ->at (0 ))
28
36
->method ('retrieve ' )
29
37
->with ($ this ->equalTo (null ), $ this ->equalTo ('http://some.host.at/somewhere/parent ' ))
30
- ->will ($ this ->returnValue ($ returnSchema ));
38
+ ->will ($ this ->returnValue ($ jsonSchema ));
31
39
32
40
return $ retriever ;
33
41
}
You can’t perform that action at this time.
0 commit comments