From c54091d43bc94728970479ea745c993f99f9b056 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 20 Mar 2017 12:41:56 +0100 Subject: [PATCH] Use authType BASIC for Sabre client in integration tests This helps massively reduce the numerous useless 401 exceptions that appears in the test log. These appear only because Sabre first connects without any auth type to receive the challenge and then sends the authentication data. With this change it will directly use basic auth. Signed-off-by: Morris Jobke --- build/integration/features/bootstrap/WebDav.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 0a75ff967325b..3a018a2d0faca 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -170,7 +170,6 @@ public function downloadFileWithRange($fileSource, $range){ public function downloadPublicFileWithRange($range){ $token = $this->lastShareData->data->token; $fullUrl = substr($this->baseUrl, 0, -4) . "public.php/webdav"; - $headers['Range'] = $range; $client = new GClient(); $options = []; @@ -189,7 +188,6 @@ public function downloadPublicFileWithRange($range){ public function downloadPublicFileInsideAFolderWithRange($path, $range){ $token = $this->lastShareData->data->token; $fullUrl = substr($this->baseUrl, 0, -4) . "public.php/webdav" . "$path"; - $headers['Range'] = $range; $client = new GClient(); $options = []; @@ -437,16 +435,17 @@ public function makeSabrePath($user, $path) { public function getSabreClient($user) { $fullUrl = substr($this->baseUrl, 0, -4); - $settings = array( + $settings = [ 'baseUri' => $fullUrl, 'userName' => $user, - ); + ]; if ($user === 'admin') { $settings['password'] = $this->adminUser[1]; } else { $settings['password'] = $this->regularUser; } + $settings['authType'] = SClient::AUTH_BASIC; return new SClient($settings); } @@ -634,15 +633,17 @@ public function userUnfavoritesElement($user, $path){ /*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/ public function changeFavStateOfAnElement($user, $path, $favOrUnfav, $folderDepth, $properties = null){ $fullUrl = substr($this->baseUrl, 0, -4); - $settings = array( + $settings = [ 'baseUri' => $fullUrl, 'userName' => $user, - ); + ]; if ($user === 'admin') { $settings['password'] = $this->adminUser[1]; } else { $settings['password'] = $this->regularUser; } + $settings['authType'] = SClient::AUTH_BASIC; + $client = new SClient($settings); if (!$properties) { $properties = [