File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,50 @@ public function testParseEmptyObject(){
128
128
Message::parseObject ((object ) []);
129
129
}
130
130
131
+ /**
132
+ * @return void
133
+ * @throws JSONRPCException
134
+ */
135
+ public function testParseRequestV1WithMethod (){
136
+ $ this ->expectException (JSONRPCException::class);
137
+ $ this ->expectExceptionMessage ('[V1] The "method" property in request MUST be a string. ' );
138
+
139
+ Message::parseObject ((object ) ['method ' =>null ]);
140
+ }
141
+
142
+ /**
143
+ * @return void
144
+ * @throws JSONRPCException
145
+ */
146
+ public function testParseRequestV1WithParams (){
147
+ $ this ->expectException (JSONRPCException::class);
148
+ $ this ->expectExceptionMessage ('[V1] Missing "method" property in request. ' );
149
+
150
+ Message::parseObject ((object ) ['params ' =>null ]);
151
+ }
152
+
153
+ /**
154
+ * @return void
155
+ * @throws JSONRPCException
156
+ */
157
+ public function testParseResponseV1WithResult (){
158
+ $ this ->expectException (JSONRPCException::class);
159
+ $ this ->expectExceptionMessage ('[V1] Missing "error" property in request. ' );
160
+
161
+ Message::parseObject ((object ) ['result ' =>null ]);
162
+ }
163
+
164
+ /**
165
+ * @return void
166
+ * @throws JSONRPCException
167
+ */
168
+ public function testParseResponseV1WithError (){
169
+ $ this ->expectException (JSONRPCException::class);
170
+ $ this ->expectExceptionMessage ('[V1] Missing "result" property in request. ' );
171
+
172
+ Message::parseObject ((object ) ['error ' =>null ]);
173
+ }
174
+
131
175
/**
132
176
* @return void
133
177
* @throws JSONRPCException
You can’t perform that action at this time.
0 commit comments