.../tests/src/Functional/FileUploadResourceTestBase.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php b/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php index f06a8ca..564ecaa 100644 --- a/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php @@ -597,24 +597,16 @@ protected function fileRequest(Url $url, $file_contents, array $headers = []) { $url->setOption('query', ['_format' => static::$format]); $request_options = []; - $request_options[RequestOptions::HTTP_ERRORS] = FALSE; - - $request_options['headers'] = $headers + [ + $request_options[RequestOptions::HEADERS] = $headers + [ // Set the required (and only accepted) content type for the request. 'Content-Type' => 'application/octet-stream', // Set the required Content-Disposition header for the file name. 'Content-Disposition' => 'file; filename="example.txt"', ]; - - $request_options['body'] = $file_contents; - + $request_options[RequestOptions::BODY] = $file_contents; $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('POST')); - $session = $this->getSession(); - $this->prepareRequest(); - - $client = $session->getDriver()->getClient()->getClient(); - return $client->request('POST', $url->setAbsolute(TRUE)->toString(), $request_options); + return $this->request('POST', $url, $request_options); } /**