]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use authType BASIC for Sabre client in integration tests 4037/head
authorVincent Petry <pvince81@owncloud.com>
Mon, 20 Mar 2017 11:41:56 +0000 (12:41 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 24 Mar 2017 18:40:14 +0000 (12:40 -0600)
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 <hey@morrisjobke.de>
build/integration/features/bootstrap/WebDav.php

index 0a75ff967325bfe0abcce499b150fc140428da05..3a018a2d0faca3752c37b26e8c0b201183047a0a 100644 (file)
@@ -170,7 +170,6 @@ trait WebDav {
        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 @@ trait WebDav {
        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 @@ trait WebDav {
        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 @@ trait WebDav {
        /*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 = [