File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -88,20 +88,22 @@ test(function (): void {
88
88
$ request = new ApiRequest (Psr7ServerRequestFactory::fromSuperGlobal ());
89
89
$ entity = new NotEmptyEntity ();
90
90
91
- $ queryRequest = $ request
92
- ->withQueryParams (['foo ' => 1 ]);
93
-
94
- $ bodyRequest = $ request
95
- ->withBody (Utils::streamFor (json_encode (['foo ' => 1 ])));
96
-
97
91
foreach ([Endpoint::METHOD_GET , Endpoint::METHOD_DELETE , Endpoint::METHOD_HEAD ] as $ method ) {
98
- $ entity = $ entity ->fromRequest ($ queryRequest ->withMethod ($ method ));
92
+ $ queryRequest = $ request
93
+ ->withQueryParams (['foo ' => 1 ])
94
+ ->withMethod ($ method );
95
+
96
+ $ entity = $ entity ->fromRequest ($ queryRequest );
99
97
100
98
Assert::same (1 , $ entity ->foo );
101
99
}
102
100
103
101
foreach ([Endpoint::METHOD_POST , Endpoint::METHOD_PUT , Endpoint::METHOD_PATCH ] as $ method ) {
104
- $ entity = $ entity ->fromRequest ($ bodyRequest ->withMethod ($ method ));
102
+ $ bodyRequest = $ request
103
+ ->withBody (Utils::streamFor (json_encode (['foo ' => 1 ])))
104
+ ->withMethod ($ method );
105
+
106
+ $ entity = $ entity ->fromRequest ($ bodyRequest );
105
107
106
108
Assert::same (1 , $ entity ->foo );
107
109
}
You can’t perform that action at this time.
0 commit comments