fromYaml($yaml)->getServerRequestValidator(); $psrRequest = (new ServerRequest('post', 'http://localhost:8000/api/v1/products.create')) ->withHeader('Content-Type', 'application/json') ->withBody(stream_for(json_encode(['test' => (object) ['some_property_here' => (object) []]]))); $validator->validate($psrRequest); $this->addToAssertionCount(1); } }