@@ -12,9 +12,9 @@ public function test_validation_should_be_delegated_to_internal_validator()
12
12
->given (
13
13
$ validator = $ this ->mockJsonSchemaValidator (),
14
14
$ this ->calling ($ validator )->check = null ,
15
- $ refResolver = $ this ->mockJsonSchemaRefResolver (),
16
- $ this ->calling ($ refResolver )->resolveRef = 'resolvedJsonSchema ' ,
17
- $ jsonSchemaTools = $ this ->mockJsonSchemaTools ($ validator , $ refResolver ),
15
+ $ schemaStorage = $ this ->mockJsonSchemaStorage (),
16
+ $ this ->calling ($ schemaStorage )->resolveRef = 'resolvedJsonSchema ' ,
17
+ $ jsonSchemaTools = $ this ->mockJsonSchemaTools ($ validator , $ schemaStorage ),
18
18
$ this ->newTestedInstance ($ jsonSchemaTools )
19
19
)
20
20
->when (
@@ -50,9 +50,9 @@ public function test_invalid_internal_validation_lead_to_exception()
50
50
$ this ->calling ($ validator )->check = null ,
51
51
$ this ->calling ($ validator )->isValid = false ,
52
52
$ this ->calling ($ validator )->getErrors = ['error1 ' , 'error2 ' ],
53
- $ refResolver = $ this ->mockJsonSchemaRefResolver (),
54
- $ this ->calling ($ refResolver )->resolve = 'resolvedJsonSchema ' ,
55
- $ jsonSchemaTools = $ this ->mockJsonSchemaTools ($ validator , $ refResolver ),
53
+ $ schemaStorage = $ this ->mockJsonSchemaStorage (),
54
+ $ this ->calling ($ schemaStorage )->resolveRef = 'resolvedJsonSchema ' ,
55
+ $ jsonSchemaTools = $ this ->mockJsonSchemaTools ($ validator , $ schemaStorage ),
56
56
$ this ->newTestedInstance ($ jsonSchemaTools )
57
57
)
58
58
->exception (function () {
@@ -71,19 +71,19 @@ private function mockJsonSchemaValidator()
71
71
return new \mock \JsonSchema \Validator ;
72
72
}
73
73
74
- private function mockJsonSchemaRefResolver ()
74
+ private function mockJsonSchemaStorage ()
75
75
{
76
76
$ this ->mockGenerator ->orphanize ('__construct ' );
77
77
78
- return new \mock \JsonSchema \JsonStorage ();
78
+ return new \mock \JsonSchema \SchemaStorage ();
79
79
}
80
80
81
- private function mockJsonSchemaTools ($ validator = null , $ refResolver = null )
81
+ private function mockJsonSchemaTools ($ validator = null , $ schemaStorage = null )
82
82
{
83
83
$ this ->mockGenerator ->orphanize ('__construct ' );
84
84
$ mock = new \mock \Rezzza \SymfonyRestApiJson \JsonSchemaTools ;
85
85
$ this ->calling ($ mock )->createValidator = $ validator ;
86
- $ this ->calling ($ mock )->createSchemaStorage = $ refResolver ;
86
+ $ this ->calling ($ mock )->createSchemaStorage = $ schemaStorage ;
87
87
88
88
return $ mock ;
89
89
}
0 commit comments