Skip to content
Snippets Groups Projects
Commit ea8b61b6 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #4037 from nextcloud/downstream-27421

Use authType BASIC for Sabre client in integration tests
parents 2f766917 c54091d4
No related branches found
No related tags found
No related merge requests found
...@@ -170,7 +170,6 @@ trait WebDav { ...@@ -170,7 +170,6 @@ trait WebDav {
public function downloadPublicFileWithRange($range){ public function downloadPublicFileWithRange($range){
$token = $this->lastShareData->data->token; $token = $this->lastShareData->data->token;
$fullUrl = substr($this->baseUrl, 0, -4) . "public.php/webdav"; $fullUrl = substr($this->baseUrl, 0, -4) . "public.php/webdav";
$headers['Range'] = $range;
$client = new GClient(); $client = new GClient();
$options = []; $options = [];
...@@ -189,7 +188,6 @@ trait WebDav { ...@@ -189,7 +188,6 @@ trait WebDav {
public function downloadPublicFileInsideAFolderWithRange($path, $range){ public function downloadPublicFileInsideAFolderWithRange($path, $range){
$token = $this->lastShareData->data->token; $token = $this->lastShareData->data->token;
$fullUrl = substr($this->baseUrl, 0, -4) . "public.php/webdav" . "$path"; $fullUrl = substr($this->baseUrl, 0, -4) . "public.php/webdav" . "$path";
$headers['Range'] = $range;
$client = new GClient(); $client = new GClient();
$options = []; $options = [];
...@@ -437,16 +435,17 @@ trait WebDav { ...@@ -437,16 +435,17 @@ trait WebDav {
public function getSabreClient($user) { public function getSabreClient($user) {
$fullUrl = substr($this->baseUrl, 0, -4); $fullUrl = substr($this->baseUrl, 0, -4);
$settings = array( $settings = [
'baseUri' => $fullUrl, 'baseUri' => $fullUrl,
'userName' => $user, 'userName' => $user,
); ];
if ($user === 'admin') { if ($user === 'admin') {
$settings['password'] = $this->adminUser[1]; $settings['password'] = $this->adminUser[1];
} else { } else {
$settings['password'] = $this->regularUser; $settings['password'] = $this->regularUser;
} }
$settings['authType'] = SClient::AUTH_BASIC;
return new SClient($settings); return new SClient($settings);
} }
...@@ -634,15 +633,17 @@ trait WebDav { ...@@ -634,15 +633,17 @@ trait WebDav {
/*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/ /*Set the elements of a proppatch, $folderDepth requires 1 to see elements without children*/
public function changeFavStateOfAnElement($user, $path, $favOrUnfav, $folderDepth, $properties = null){ public function changeFavStateOfAnElement($user, $path, $favOrUnfav, $folderDepth, $properties = null){
$fullUrl = substr($this->baseUrl, 0, -4); $fullUrl = substr($this->baseUrl, 0, -4);
$settings = array( $settings = [
'baseUri' => $fullUrl, 'baseUri' => $fullUrl,
'userName' => $user, 'userName' => $user,
); ];
if ($user === 'admin') { if ($user === 'admin') {
$settings['password'] = $this->adminUser[1]; $settings['password'] = $this->adminUser[1];
} else { } else {
$settings['password'] = $this->regularUser; $settings['password'] = $this->regularUser;
} }
$settings['authType'] = SClient::AUTH_BASIC;
$client = new SClient($settings); $client = new SClient($settings);
if (!$properties) { if (!$properties) {
$properties = [ $properties = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment