File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -88,20 +88,22 @@ test(function (): void {
8888 $ request = new ApiRequest (Psr7ServerRequestFactory::fromSuperGlobal ());
8989 $ entity = new NotEmptyEntity ();
9090
91- $ queryRequest = $ request
92- ->withQueryParams (['foo ' => 1 ]);
93-
94- $ bodyRequest = $ request
95- ->withBody (Utils::streamFor (json_encode (['foo ' => 1 ])));
96-
9791 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 );
9997
10098 Assert::same (1 , $ entity ->foo );
10199 }
102100
103101 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 );
105107
106108 Assert::same (1 , $ entity ->foo );
107109 }
You can’t perform that action at this time.
0 commit comments