'INVALID']; $psrRequest = (new ServerRequest('post', 'http://localhost:8000/api/test/create')) ->withHeader('Content-Type', 'application/json') ->withBody(stream_for(json_encode($data))); $serverRequestValidator = (new ValidatorBuilder())->fromYaml($yaml)->getServerRequestValidator(); $this->expectException(ValidationFailed::class); $serverRequestValidator->validate($psrRequest); } }