diff --git a/tests/TestHelpers/AppConfigHelper.php b/tests/TestHelpers/AppConfigHelper.php
index c030b5482897..6d47837d2a66 100644
--- a/tests/TestHelpers/AppConfigHelper.php
+++ b/tests/TestHelpers/AppConfigHelper.php
@@ -21,7 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper to set various configurations through the testing app
diff --git a/tests/TestHelpers/DeleteHelper.php b/tests/TestHelpers/DeleteHelper.php
index 7946ea2b570a..d7becf8b0818 100644
--- a/tests/TestHelpers/DeleteHelper.php
+++ b/tests/TestHelpers/DeleteHelper.php
@@ -21,7 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper for deleting files
diff --git a/tests/TestHelpers/DownloadHelper.php b/tests/TestHelpers/DownloadHelper.php
index b66e19bee56b..796424dacf8e 100644
--- a/tests/TestHelpers/DownloadHelper.php
+++ b/tests/TestHelpers/DownloadHelper.php
@@ -21,7 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper for Downloads
diff --git a/tests/TestHelpers/EmailHelper.php b/tests/TestHelpers/EmailHelper.php
index c1384f5c8145..a4076bd919c4 100644
--- a/tests/TestHelpers/EmailHelper.php
+++ b/tests/TestHelpers/EmailHelper.php
@@ -21,7 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper to test email sending, using mailhog
diff --git a/tests/TestHelpers/HttpRequestHelper.php b/tests/TestHelpers/HttpRequestHelper.php
index c0959bbc4946..fc2069f5c592 100644
--- a/tests/TestHelpers/HttpRequestHelper.php
+++ b/tests/TestHelpers/HttpRequestHelper.php
@@ -25,11 +25,13 @@
use GuzzleHttp\Client;
use GuzzleHttp\Cookie\CookieJar;
use GuzzleHttp\Exception\BadResponseException;
-use GuzzleHttp\Message\ResponseInterface;
+use GuzzleHttp\Exception\GuzzleException;
+use GuzzleHttp\Psr7\Request;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
use SimpleXMLElement;
use Sabre\Xml\LibXMLException;
use Sabre\Xml\Reader;
-use GuzzleHttp\BatchResults;
use GuzzleHttp\Pool;
/**
@@ -68,25 +70,28 @@ public static function sendRequest(
$client = null
) {
if ($client === null) {
- $client = new Client();
+ $client = self::createClient(
+ $user,
+ $password,
+ $config,
+ $cookies,
+ $stream,
+ $timeout
+ );
}
+ /**
+ * @var RequestInterface $request
+ */
$request = self::createRequest(
$url,
$method,
- $user,
- $password,
$headers,
- $body,
- $config,
- $cookies,
- $stream,
- $timeout,
- $client
+ $body
);
try {
$response = $client->send($request);
- } catch (BadResponseException $ex) {
+ } catch (GuzzleException $ex) {
$response = $ex->getResponse();
//if the response was null for some reason do not return it but re-throw
@@ -103,65 +108,44 @@ public static function sendRequest(
* It will send all the requests to the server using the Pool object in guzzle.
*
* @param array $requests
- * @param Client|null $client
+ * @param Client $client
*
- * @return BatchResults
+ * @return array
*/
public static function sendBatchRequest(
$requests,
- $client = null
+ $client
) {
- if (!isset($client)) {
- $client = new Client();
- }
$results = Pool::batch($client, $requests);
return $results;
}
/**
- * Create an http request based on given parameters.
- * This creates an RequestInterface object before sending it to the server.
- * This also enables to create multiple requests in advance so that we can send them to the server at once in parallel.
+ * Create a Guzzle Client
+ * This creates a client object that can be used later to send a request object(s)
*
- * @param string $url
- * @param string $method
* @param string $user
* @param string $password
- * @param array $headers ['X-MyHeader' => 'value']
- * @param mixed $body
* @param array $config
* @param CookieJar $cookies
* @param bool $stream Set to true to stream a response rather
* than download it all up-front.
* @param int $timeout
- * @param Client|null $client
*
- * @return RequestInterface
+ * @return Client
*/
- public static function createRequest(
- $url,
- $method = 'GET',
+ public static function createClient(
$user = null,
$password = null,
- $headers = null,
- $body = null,
$config = null,
$cookies = null,
$stream = false,
- $timeout = 0,
- $client = null
+ $timeout = 0
) {
- if ($client === null) {
- $client = new Client();
- }
-
$options = [];
if ($user !== null) {
$options['auth'] = [$user, $password];
}
- if ($body !== null) {
- $options['body'] = $body;
- }
if ($config !== null) {
$options['config'] = $config;
}
@@ -171,16 +155,44 @@ public static function createRequest(
$options['stream'] = $stream;
$options['verify'] = false;
$options['timeout'] = $timeout;
- $request = $client->createRequest($method, $url, $options);
- if ($headers !== null) {
- foreach ($headers as $key => $value) {
- if ($request->hasHeader($key) === true) {
- $request->setHeader($key, $value);
- } else {
- $request->addHeader($key, $value);
- }
- }
+ $client = new Client($options);
+ return $client;
+ }
+
+ /**
+ * Create an http request based on given parameters.
+ * This creates a RequestInterface object that can be used with a client to send a request.
+ * This enables us to create multiple requests in advance so that we can send them to the server at once in parallel.
+ *
+ * @param string $url
+ * @param string $method
+ * @param array $headers ['X-MyHeader' => 'value']
+ * @param string|array $body either the actual string to send in the body,
+ * or an array of key-value pairs to be converted
+ * into a body with http_build_query.
+ *
+ * @return RequestInterface
+ */
+ public static function createRequest(
+ $url,
+ $method = 'GET',
+ $headers = null,
+ $body = null
+ ) {
+ if ($headers === null) {
+ $headers = [];
}
+ if (\is_array($body)) {
+ // when creating the client, it is possible to set 'form_params' and
+ // the Client constructor sorts out doing this http_build_query stuff.
+ // But 'new Request' does not have the flexibility to do that.
+ // So we need to do it here.
+ $body = \http_build_query($body, '', '&');
+ $headers['Content-Type'] = 'application/x-www-form-urlencoded';
+ }
+ $request = new Request(
+ $method, $url, $headers, $body
+ );
return $request;
}
@@ -320,7 +332,9 @@ public static function delete(
* @return SimpleXMLElement
*/
public static function getResponseXml($response) {
- return $response->xml();
+ // rewind just to make sure we can re-parse it in case it was parsed already...
+ $response->getBody()->rewind();
+ return new SimpleXMLElement($response->getBody()->getContents());
}
/**
diff --git a/tests/TestHelpers/MoveCopyHelper.php b/tests/TestHelpers/MoveCopyHelper.php
index 268b28ffee54..59566ed0affd 100644
--- a/tests/TestHelpers/MoveCopyHelper.php
+++ b/tests/TestHelpers/MoveCopyHelper.php
@@ -21,7 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper for move and copy files
diff --git a/tests/TestHelpers/OcsApiHelper.php b/tests/TestHelpers/OcsApiHelper.php
index 9a46ff496fe8..c33c26e6e5c3 100644
--- a/tests/TestHelpers/OcsApiHelper.php
+++ b/tests/TestHelpers/OcsApiHelper.php
@@ -21,8 +21,8 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
-use GuzzleHttp\Client;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper to make requests to the OCS API
@@ -59,19 +59,16 @@ public static function sendRequest(
/**
*
* @param string $baseUrl
- * @param string $user if set to null no authentication header will be sent
- * @param string $password
* @param string $method HTTP Method
* @param string $path
* @param array $body array of key, value pairs e.g ['value' => 'yes']
- * @param Client|null $client
* @param int $ocsApiVersion (1|2) default 2
* @param array $headers
*
* @return RequestInterface
*/
public static function createOcsRequest(
- $baseUrl, $user, $password, $method, $path, $body = [], $client = null, $ocsApiVersion = 2, $headers = []
+ $baseUrl, $method, $path, $body = [], $ocsApiVersion = 2, $headers = []
) {
$fullUrl = $baseUrl;
if (\substr($fullUrl, -1) !== '/') {
@@ -81,15 +78,8 @@ public static function createOcsRequest(
return HttpRequestHelper::createRequest(
$fullUrl,
$method,
- $user,
- $password,
$headers,
- $body,
- null,
- null,
- null,
- null,
- $client
+ $body
);
}
}
diff --git a/tests/TestHelpers/SetupHelper.php b/tests/TestHelpers/SetupHelper.php
index d1b115a1780a..355a7762cbd9 100644
--- a/tests/TestHelpers/SetupHelper.php
+++ b/tests/TestHelpers/SetupHelper.php
@@ -24,7 +24,7 @@
use Behat\Testwork\Hook\Scope\HookScope;
use GuzzleHttp\Exception\ServerException;
use Exception;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use SimpleXMLElement;
/**
@@ -681,9 +681,10 @@ public static function runOcc(
}
$return = [];
- $return['code'] = $result->xml()->xpath("//ocs/data/code");
- $return['stdOut'] = $result->xml()->xpath("//ocs/data/stdOut");
- $return['stdErr'] = $result->xml()->xpath("//ocs/data/stdErr");
+ $resultXml = \simplexml_load_string($result->getBody()->getContents());
+ $return['code'] = $resultXml->xpath("//ocs/data/code");
+ $return['stdOut'] = $resultXml->xpath("//ocs/data/stdOut");
+ $return['stdErr'] = $resultXml->xpath("//ocs/data/stdErr");
if (!isset($return['code'][0])) {
throw new Exception(
diff --git a/tests/TestHelpers/SharingHelper.php b/tests/TestHelpers/SharingHelper.php
index 75c00b8b8daf..43ccf898e19b 100644
--- a/tests/TestHelpers/SharingHelper.php
+++ b/tests/TestHelpers/SharingHelper.php
@@ -21,7 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
/**
* manage Shares via OCS API
diff --git a/tests/TestHelpers/TagsHelper.php b/tests/TestHelpers/TagsHelper.php
index c287d208998b..28bd2fc87a38 100644
--- a/tests/TestHelpers/TagsHelper.php
+++ b/tests/TestHelpers/TagsHelper.php
@@ -21,7 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use Exception;
use SimpleXMLElement;
diff --git a/tests/TestHelpers/Unit/DeleteHelperTest.php b/tests/TestHelpers/Unit/DeleteHelperTest.php
index 005dc1887d79..b01e448c0850 100644
--- a/tests/TestHelpers/Unit/DeleteHelperTest.php
+++ b/tests/TestHelpers/Unit/DeleteHelperTest.php
@@ -22,14 +22,17 @@
use TestHelpers\DeleteHelper;
use GuzzleHttp\Client;
-use GuzzleHttp\Subscriber\Mock;
-use GuzzleHttp\Message\Response;
-use GuzzleHttp\Subscriber\History;
+use GuzzleHttp\Handler\MockHandler;
+use GuzzleHttp\HandlerStack;
+use GuzzleHttp\Middleware;
+use GuzzleHttp\Psr7\Response;
+use GuzzleHttp\Psr7\Request;
/**
* Unit tests for TestHelpers\DeleteHelper;
*/
class DeleteHelperTest extends PHPUnit\Framework\TestCase {
+ private $container = [];
/**
* Setup http client, mock requests, and attach history
@@ -37,16 +40,14 @@ class DeleteHelperTest extends PHPUnit\Framework\TestCase {
* @return void
*/
public function setUp(): void {
- $mock = new Mock(
+ $mock = new MockHandler(
[ new Response(204, [])]
);
+ $handler = HandlerStack::create($mock);
+ $history = Middleware::history($this->container);
+ $handler->push($history);
- $this->client = new Client();
-
- $this->history = new History();
-
- $this->client->getEmitter()->attach($mock);
- $this->client->getEmitter()->attach($this->history);
+ $this->client = new Client(['handler' => $handler]);
}
/**
@@ -66,18 +67,16 @@ public function testDeleteHelperWithOlderDavVersion() {
$this->client
);
- $lastRequest = $this->history->getLastRequest();
+ /**
+ * @var Request $lastRequest
+ */
+ $lastRequest = $this->container[0]['request'];
$this->assertEquals(
'http://localhost/remote.php/webdav/secret/file.txt',
- $lastRequest->getUrl()
+ $lastRequest->getUri()
);
$this->assertEquals('DELETE', $lastRequest->getMethod());
- $this->assertNull($lastRequest->getBody());
-
- $this->assertEquals(
- ['Basic ' . \base64_encode('user:password')],
- $lastRequest->getHeaders()["Authorization"]
- );
+ $this->assertEquals('', $lastRequest->getBody()->getContents());
}
/**
@@ -97,18 +96,16 @@ public function testDeleteHelperWithNewerDavVersion() {
$this->client
);
- $lastRequest = $this->history->getLastRequest();
+ /**
+ * @var Request $lastRequest
+ */
+ $lastRequest = $this->container[0]['request'];
$this->assertEquals(
'http://localhost/remote.php/dav/files/user/secret/file.txt',
- $lastRequest->getUrl()
+ $lastRequest->getUri()
);
$this->assertEquals('DELETE', $lastRequest->getMethod());
- $this->assertNull($lastRequest->getBody());
-
- $this->assertEquals(
- ['Basic ' . \base64_encode('user:password')],
- $lastRequest->getHeaders()["Authorization"]
- );
+ $this->assertEquals('', $lastRequest->getBody()->getContents());
}
/**
@@ -129,7 +126,10 @@ public function testDeleteHelperSendsWithGivenHeaders() {
$this->client
);
- $lastRequest = $this->history->getLastRequest();
+ /**
+ * @var Request $lastRequest
+ */
+ $lastRequest = $this->container[0]['request'];
$this->assertArrayHasKey("Cache-Control", $lastRequest->getHeaders());
// Guzzle adds it to the array
diff --git a/tests/TestHelpers/Unit/WebDavHelperTest.php b/tests/TestHelpers/Unit/WebDavHelperTest.php
index 19427cd9f4f8..d4787af1a82a 100644
--- a/tests/TestHelpers/Unit/WebDavHelperTest.php
+++ b/tests/TestHelpers/Unit/WebDavHelperTest.php
@@ -22,14 +22,22 @@
use TestHelpers\WebDavHelper;
use GuzzleHttp\Client;
-use GuzzleHttp\Subscriber\Mock;
-use GuzzleHttp\Message\Response;
-use GuzzleHttp\Subscriber\History;
+use GuzzleHttp\Handler\MockHandler;
+use GuzzleHttp\HandlerStack;
+use GuzzleHttp\Middleware;
+use GuzzleHttp\Psr7\Response;
+use GuzzleHttp\Psr7\Request;
/**
* Test for WebDavHelper
*/
class WebDavHelperTest extends PHPUnit\Framework\TestCase {
+ private $container = [];
+ /**
+ * @var Client
+ */
+ private $client;
+
/**
* Setup mock response, client and listen for all requests
* through history.
@@ -39,15 +47,14 @@ class WebDavHelperTest extends PHPUnit\Framework\TestCase {
public function setUp(): void {
// mocks is not used, but is required. Else it will try to
// contact original server and will fail our tests.
- $mock = new Mock(
+ $mock = new MockHandler(
[new Response(200, []),]
);
+ $handler = HandlerStack::create($mock);
+ $history = Middleware::history($this->container);
+ $handler->push($history);
- $this->client = new Client();
- $this->history = new History();
-
- $this->client->getEmitter()->attach($mock);
- $this->client->getEmitter()->attach($this->history);
+ $this->client = new Client(['handler' => $handler]);
}
/**
@@ -74,17 +81,16 @@ public function testUrlIsSanitizedByMakeDavRequestForNewerDav() {
$this->client
);
- $lastRequest = $this->history->getLastRequest();
+ /**
+ * @var Request $lastRequest
+ */
+ $lastRequest = $this->container[0]['request'];
$this->assertEquals(
'http://own.cloud/core/remote.php/webdav/folder/file.txt',
- $lastRequest->getUrl()
+ $lastRequest->getUri()
);
$this->assertEquals('GET', $lastRequest->getMethod());
- $this->assertEquals(
- ['Basic ' . \base64_encode('user1:pass')],
- $lastRequest->getHeaders()["Authorization"]
- );
}
/**
@@ -111,11 +117,14 @@ public function testUrlIsSanitizedByMakeDavRequestForOlderDavPath() {
$this->client
);
- $lastRequest = $this->history->getLastRequest();
+ /**
+ * @var Request $lastRequest
+ */
+ $lastRequest = $this->container[0]['request'];
$this->assertEquals(
'http://own.cloud/core/remote.php/dav/files/user1/folder/file.txt',
- $lastRequest->getUrl()
+ $lastRequest->getUri()
);
$this->assertEquals('GET', $lastRequest->getMethod());
}
@@ -144,11 +153,14 @@ public function testMakeDavRequestReplacesAsteriskAndHashesOnUrls() {
$this->client
);
- $lastRequest = $this->history->getLastRequest();
+ /**
+ * @var Request $lastRequest
+ */
+ $lastRequest = $this->container[0]['request'];
$this->assertEquals(
'http://own.cloud/core/remote.php/dav/files/user1/folder/file%3Fq=hello%23newfile',
- $lastRequest->getUrl()
+ $lastRequest->getUri()
);
// not just the link, but `Destination` header should have also been replaced
@@ -182,7 +194,10 @@ public function testMakeDavRequestOnBearerAuthorization() {
$this->client
);
- $lastRequest = $this->history->getLastRequest();
+ /**
+ * @var Request $lastRequest
+ */
+ $lastRequest = $this->container[0]['request'];
// no way to know that $user and $password is set to null, except confirming that
// the Authorization is `Bearer`. If it would have gotten username and password,
diff --git a/tests/TestHelpers/UploadHelper.php b/tests/TestHelpers/UploadHelper.php
index c364ee9da2aa..3dca936697c2 100644
--- a/tests/TestHelpers/UploadHelper.php
+++ b/tests/TestHelpers/UploadHelper.php
@@ -21,8 +21,7 @@
*/
namespace TestHelpers;
-use GuzzleHttp\Message\ResponseInterface;
-use GuzzleHttp\Stream\Stream;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper for Uploads
@@ -64,7 +63,7 @@ public static function upload(
//simple upload with no chunking
if ($chunkingVersion === null) {
- $data = Stream::factory(\fopen($source, 'r'));
+ $data = \file_get_contents($source);
return WebDavHelper::makeDavRequest(
$baseUrl,
$user,
@@ -104,7 +103,6 @@ public static function upload(
//upload chunks
foreach ($chunks as $index => $chunk) {
- $data = Stream::factory($chunk);
if ($chunkingVersion === 1) {
$filename = $destination . "-" . $chunkingId . "-" .
\count($chunks) . '-' . ( string ) $index;
@@ -120,7 +118,7 @@ public static function upload(
"PUT",
$filename,
$headers,
- $data,
+ $chunk,
$davPathVersionToUse,
$davRequestType
);
diff --git a/tests/TestHelpers/UserHelper.php b/tests/TestHelpers/UserHelper.php
index 8b78a5a5db62..d93cffcfb377 100644
--- a/tests/TestHelpers/UserHelper.php
+++ b/tests/TestHelpers/UserHelper.php
@@ -21,9 +21,8 @@
*/
namespace TestHelpers;
-use GuzzleHttp\BatchResults;
-use GuzzleHttp\Message\ResponseInterface;
-use GuzzleHttp\Client;
+use GuzzleHttp\Exception\ClientException;
+use Psr\Http\Message\ResponseInterface;
/**
* Helper to administrate users (and groups) through the provisioning API
@@ -114,13 +113,17 @@ public static function editUser(
* @param string $adminPassword
* @param int $ocsApiVersion
*
- * @return BatchResults
+ * @return array
*/
public static function editUserBatch(
$baseUrl, $editData, $adminUser, $adminPassword, $ocsApiVersion = 2
) {
- $client = new Client();
$requests = [];
+ $client = HttpRequestHelper::createClient(
+ $adminUser,
+ $adminPassword
+ );
+
foreach ($editData as $data) {
$path = "/cloud/users/" . $data['user'];
$body = ["key" => $data['key'], 'value' => $data["value"]];
@@ -129,26 +132,23 @@ public static function editUserBatch(
$requests,
OcsApiHelper::createOcsRequest(
$baseUrl,
- $adminUser,
- $adminPassword,
'PUT',
$path,
- $body,
- $client
+ $body
)
);
}
// Send the array of requests at once in parallel.
$results = HttpRequestHelper::sendBatchRequest($requests, $client);
- foreach ($results->getFailures() as $e) {
- $pathArray = \explode('/', $e->getRequest()->getPath());
- $failedUser = \end($pathArray);
- $editData = $e->getRequest()->getBody()->getFields();
- throw new \Exception(
- "Could not set '${editData['key']}' to '${editData['value']}' for user '$failedUser' \n"
- . $e->getResponse()->getStatusCode() . "\n" . $e->getResponse()->getBody()
- );
+ foreach ($results as $e) {
+ if ($e instanceof ClientException) {
+ $httpStatusCode = $e->getResponse()->getStatusCode();
+ $reasonPhrase = $e->getResponse()->getReasonPhrase();
+ throw new \Exception(
+ "Unexpected failure when editing a user: HTTP status $httpStatusCode HTTP reason $reasonPhrase"
+ );
+ }
}
return $results;
}
diff --git a/tests/TestHelpers/WebDavHelper.php b/tests/TestHelpers/WebDavHelper.php
index c28b0c525041..de8be11dfa1f 100644
--- a/tests/TestHelpers/WebDavHelper.php
+++ b/tests/TestHelpers/WebDavHelper.php
@@ -22,10 +22,10 @@
namespace TestHelpers;
use Exception;
-use GuzzleHttp\Message\ResponseInterface;
-use GuzzleHttp\Stream\Stream;
-use GuzzleHttp\Stream\StreamInterface;
+use GuzzleHttp\Client;
use InvalidArgumentException;
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\StreamInterface;
use SimpleXMLElement;
/**
@@ -52,21 +52,26 @@ public static function getFileIdForPath(
$password,
$path
) {
- $body = Stream::factory(
- '
+ $body
+ = '
-'
- );
+';
$response = self::makeDavRequest(
$baseUrl, $user, $password, "PROPFIND", $path, null, $body
);
- \preg_match('/\([^\<]*)\<\/oc:fileid\>/', $response, $matches);
+ \preg_match(
+ '/\([^\<]*)\<\/oc:fileid\>/',
+ $response->getBody()->getContents(),
+ $matches
+ );
+
if (!isset($matches[1])) {
throw new Exception("could not find fileId of $path");
}
+
return $matches[1];
}
@@ -378,7 +383,7 @@ public static function listFolder(
* @param string $method PUT, GET, DELETE, etc.
* @param string $path
* @param array $headers
- * @param StreamInterface $body
+ * @param string|null|resource|StreamInterface $body
* @param int $davPathVersionToUse (1|2)
* @param string $type of request
* @param string $sourceIpAddress to initiate the request from
@@ -427,10 +432,9 @@ public static function makeDavRequest(
foreach ($headers as $key => $value) {
//? and # need to be encoded in the Destination URL
if ($key === "Destination") {
- $value = \str_replace(
+ $headers[$key] = \str_replace(
$urlSpecialChar[0], $urlSpecialChar[1], $value
);
- $headers[$key] = $value;
break;
}
}
diff --git a/tests/acceptance/features/apiWebdavOperations/search.feature b/tests/acceptance/features/apiWebdavOperations/search.feature
index 3880f6e31441..b57c21f589d6 100644
--- a/tests/acceptance/features/apiWebdavOperations/search.feature
+++ b/tests/acceptance/features/apiWebdavOperations/search.feature
@@ -25,7 +25,7 @@ Feature: Search
Given using DAV path
When user "user0" searches for "upload" using the WebDAV API
Then the HTTP status code should be "207"
- And the search result should contain these entries:
+ And the search result of user "user0" should contain these entries:
| /upload.txt |
| /just-a-folder/upload.txt |
| /upload folder |
@@ -33,7 +33,7 @@ Feature: Search
| /फनी näme/upload.txt |
| /upload😀 😁 |
| /upload😀 😁/upload😀 😁.txt |
- But the search result should not contain these entries:
+ But the search result of user "user0" should not contain these entries:
| /a-image.png |
Examples:
| dav_version |
@@ -45,7 +45,7 @@ Feature: Search
When user "user0" searches for "ol" using the WebDAV API
Then the HTTP status code should be "207"
And the search result should contain "4" entries
- And the search result should contain these entries:
+ And the search result of user "user0" should contain these entries:
| /just-a-folder |
| /upload folder |
| /FOLDER |
@@ -59,11 +59,11 @@ Feature: Search
Given using DAV path
When user "user0" searches for "png" using the WebDAV API
Then the HTTP status code should be "207"
- And the search result should contain these entries:
+ And the search result of user "user0" should contain these entries:
| /a-image.png |
| /just-a-folder/a-image.png |
| /फनी näme/a-image.png |
- But the search result should not contain these entries:
+ But the search result of user "user0" should not contain these entries:
| /upload.txt |
| /just-a-folder/upload.txt |
| /just-a-folder/uploadÜठिF.txt |
@@ -85,7 +85,7 @@ Feature: Search
Given using DAV path
When user "user0" searches for "upload" and limits the results to "3" items using the WebDAV API
Then the HTTP status code should be "207"
- And the search result should contain any "3" of these entries:
+ And the search result of user "user0" should contain any "3" of these entries:
| /just-a-folder/upload.txt |
| /just-a-folder/uploadÜठिF.txt |
| /upload folder |
@@ -102,7 +102,7 @@ Feature: Search
Given using DAV path
When user "user0" searches for "upload" and limits the results to "1" items using the WebDAV API
Then the HTTP status code should be "207"
- And the search result should contain any "1" of these entries:
+ And the search result of user "user0" should contain any "1" of these entries:
| /just-a-folder/upload.txt |
| /just-a-folder/uploadÜठिF.txt |
| /upload folder |
@@ -120,7 +120,7 @@ Feature: Search
When user "user0" searches for "upload" and limits the results to "100" items using the WebDAV API
Then the HTTP status code should be "207"
And the search result should contain "7" entries
- And the search result should contain these entries:
+ And the search result of user "user0" should contain these entries:
| /upload.txt |
| /just-a-folder/upload.txt |
| /upload folder |
@@ -146,7 +146,7 @@ Feature: Search
| oc:owner-display-name |
| oc:size |
Then the HTTP status code should be "207"
- And file "/upload.txt" in the search result should contain these properties:
+ And file "/upload.txt" in the search result of user "user0" should contain these properties:
| name | value |
| {http://owncloud.org/ns}fileid | \d* |
| {http://owncloud.org/ns}permissions | ^(RDNVW\|RMDNVW)$ |
@@ -174,7 +174,7 @@ Feature: Search
| oc:owner-display-name |
| oc:size |
Then the HTTP status code should be "207"
- And folder "/upload folder" in the search result should contain these properties:
+ And folder "/upload folder" in the search result of user "user0" should contain these properties:
| name | value |
| {http://owncloud.org/ns}fileid | \d* |
| {http://owncloud.org/ns}permissions | ^(RDNVCK\|RMDNVCK)$ |
@@ -192,10 +192,10 @@ Feature: Search
Given using DAV path
When user "user0" searches for "😀 😁" using the WebDAV API
Then the HTTP status code should be "207"
- And the search result should contain these entries:
+ And the search result of user "user0" should contain these entries:
| /upload😀 😁 |
| /upload😀 😁/upload😀 😁.txt |
- But the search result should not contain these entries:
+ But the search result of user "user0" should not contain these entries:
| /a-image.png |
| /upload.txt |
| /just-a-folder/upload.txt |
diff --git a/tests/acceptance/features/bootstrap/CalDavContext.php b/tests/acceptance/features/bootstrap/CalDavContext.php
index e1185b0d0b82..15eee2092284 100644
--- a/tests/acceptance/features/bootstrap/CalDavContext.php
+++ b/tests/acceptance/features/bootstrap/CalDavContext.php
@@ -20,7 +20,7 @@
*/
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use TestHelpers\HttpRequestHelper;
/**
diff --git a/tests/acceptance/features/bootstrap/CardDavContext.php b/tests/acceptance/features/bootstrap/CardDavContext.php
index 82bd47d2309f..087818d9256e 100644
--- a/tests/acceptance/features/bootstrap/CardDavContext.php
+++ b/tests/acceptance/features/bootstrap/CardDavContext.php
@@ -21,7 +21,7 @@
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use PHPUnit\Framework\Assert;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use TestHelpers\HttpRequestHelper;
/**
diff --git a/tests/acceptance/features/bootstrap/ChecksumContext.php b/tests/acceptance/features/bootstrap/ChecksumContext.php
index 436a2f8a64f9..15187c7b2c14 100644
--- a/tests/acceptance/features/bootstrap/ChecksumContext.php
+++ b/tests/acceptance/features/bootstrap/ChecksumContext.php
@@ -51,11 +51,8 @@ class ChecksumContext implements Context {
public function userUploadsFileToWithChecksumUsingTheAPI(
$user, $source, $destination, $checksum
) {
- $file = \GuzzleHttp\Stream\Stream::factory(
- \fopen(
- $this->featureContext->acceptanceTestsDirLocation() . $source,
- 'r'
- )
+ $file = \file_get_contents(
+ $this->featureContext->acceptanceTestsDirLocation() . $source
);
$response = $this->featureContext->makeDavRequest(
$user,
@@ -217,7 +214,7 @@ public function theWebdavChecksumOfViaPropfindShouldMatch($user, $path, $checksu
*/
public function theHeaderChecksumShouldMatch($checksum) {
$headerChecksum
- = $this->featureContext->getResponse()->getHeader('OC-Checksum');
+ = $this->featureContext->getResponse()->getHeader('OC-Checksum')[0];
Assert::assertEquals(
$checksum,
$headerChecksum,
@@ -281,7 +278,6 @@ public function userUploadsChunkFileOfWithToWithChecksum(
$user, $num, $total, $data, $destination, $checksum
) {
$num -= 1;
- $data = \GuzzleHttp\Stream\Stream::factory($data);
$file = "$destination-chunking-42-$total-$num";
$response = $this->featureContext->makeDavRequest(
$user,
diff --git a/tests/acceptance/features/bootstrap/FavoritesContext.php b/tests/acceptance/features/bootstrap/FavoritesContext.php
index 9fbe52bb7bc6..2960e10a6865 100644
--- a/tests/acceptance/features/bootstrap/FavoritesContext.php
+++ b/tests/acceptance/features/bootstrap/FavoritesContext.php
@@ -23,7 +23,7 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use TestHelpers\WebDavHelper;
require_once 'bootstrap.php';
@@ -170,7 +170,7 @@ public function checkFavoritedElements(
) {
$this->userListsFavoriteOfFolder($user, $folder, null);
$this->featureContext->propfindResultShouldContainEntries(
- $shouldOrNot, $expectedElements
+ $shouldOrNot, $expectedElements, $user
);
}
diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php
index 054b309b1a94..f90b3645a45e 100644
--- a/tests/acceptance/features/bootstrap/FeatureContext.php
+++ b/tests/acceptance/features/bootstrap/FeatureContext.php
@@ -27,7 +27,7 @@
use Behat\Gherkin\Node\TableNode;
use Behat\Testwork\Hook\Scope\BeforeSuiteScope;
use GuzzleHttp\Cookie\CookieJar;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\Assert;
use TestHelpers\AppConfigHelper;
use TestHelpers\OcsApiHelper;
@@ -2477,7 +2477,7 @@ public function theConfigKeyOfAppShouldHaveValue($key, $appID, $value) {
[],
$this->getOcsApiVersion()
);
- $configkeyValue = \json_decode(\json_encode($this->getResponseXml($response)->data[0]->element->value), 1)[0];
+ $configkeyValue = (string) $this->getResponseXml($response)->data[0]->element->value;
Assert::assertEquals(
$value, $configkeyValue,
"The config key {$key} of app {$appID} was expected to have value {$value} but got {$configkeyValue}"
diff --git a/tests/acceptance/features/bootstrap/NotificationsCoreContext.php b/tests/acceptance/features/bootstrap/NotificationsCoreContext.php
index f49221beffcc..0cf2d832241f 100644
--- a/tests/acceptance/features/bootstrap/NotificationsCoreContext.php
+++ b/tests/acceptance/features/bootstrap/NotificationsCoreContext.php
@@ -22,7 +22,7 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\Assert;
use TestHelpers\OcsApiHelper;
diff --git a/tests/acceptance/features/bootstrap/OCSContext.php b/tests/acceptance/features/bootstrap/OCSContext.php
index 3ce256ae7875..5ed741893c4d 100644
--- a/tests/acceptance/features/bootstrap/OCSContext.php
+++ b/tests/acceptance/features/bootstrap/OCSContext.php
@@ -24,7 +24,7 @@
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\Assert;
use TestHelpers\OcsApiHelper;
diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php
index ff2ee210c416..97a885bfafd8 100644
--- a/tests/acceptance/features/bootstrap/Provisioning.php
+++ b/tests/acceptance/features/bootstrap/Provisioning.php
@@ -20,8 +20,8 @@
*/
use Behat\Gherkin\Node\TableNode;
-use GuzzleHttp\Client;
-use GuzzleHttp\Message\ResponseInterface;
+use GuzzleHttp\Exception\ClientException;
+use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\Assert;
use TestHelpers\OcsApiHelper;
use TestHelpers\SetupHelper;
@@ -718,7 +718,10 @@ public function resetOldLdapConfig() {
*/
public function usersHaveBeenCreated($initialize, $usersAttributes) {
$requests = [];
- $client = new Client();
+ $client = HttpRequestHelper::createClient(
+ $this->getAdminUsername(),
+ $this->getAdminPassword()
+ );
foreach ($usersAttributes as $userAttributes) {
if ($this->isTestingWithLdap()) {
@@ -727,12 +730,9 @@ public function usersHaveBeenCreated($initialize, $usersAttributes) {
// Create a OCS request for creating the user. The request is not sent to the server yet.
$request = OcsApiHelper::createOcsRequest(
$this->getBaseUrl(),
- $this->getAdminUsername(),
- $this->getAdminPassword(),
'POST',
"/cloud/users",
- $userAttributes,
- $client
+ $userAttributes
);
// Add the request to the $requests array so that they can be sent in parallel.
\array_push($requests, $request);
@@ -742,19 +742,17 @@ public function usersHaveBeenCreated($initialize, $usersAttributes) {
if (!$this->isTestingWithLdap()) {
$results = HttpRequestHelper::sendBatchRequest($requests, $client);
// Retrieve all failures.
- foreach ($results->getFailures() as $e) {
- $failedUser = $e->getRequest()->getBody()->getFields()['userid'];
- $message = $this->getResponseXml($e->getResponse())->xpath("/ocs/meta/message");
- if ($message && (string)$message[0] === "User already exists") {
- Assert::fail(
- "Could not create user '$failedUser' as it already exists. " .
- "Please delete the user to run tests again."
+ foreach ($results as $e) {
+ if ($e instanceof ClientException) {
+ $responseXml = $this->getResponseXml($e->getResponse());
+ $messageText = (string) $responseXml->xpath("/ocs/meta/message")[0];
+ $ocsStatusCode = (string) $responseXml->xpath("/ocs/meta/statuscode")[0];
+ $httpStatusCode = $e->getResponse()->getStatusCode();
+ $reasonPhrase = $e->getResponse()->getReasonPhrase();
+ throw new Exception(
+ __METHOD__ . "Unexpected failure when creating a user: HTTP status $httpStatusCode HTTP reason $reasonPhrase OCS status $ocsStatusCode OCS message $messageText"
);
}
- throw new Exception(
- __METHOD__ . " could not create user. "
- . $e->getResponse()->getStatusCode() . " " . $e->getResponse()->getBody()
- );
}
}
@@ -782,9 +780,10 @@ public function usersHaveBeenCreated($initialize, $usersAttributes) {
);
}
- // If the users need to be initialized then initialize them in parallel.
if ($initialize) {
- $this->initializeUserBatch($users);
+ // We need to initialize each user using the individual authentication of each user.
+ // That is not possible in Guzzle6 batch mode. So we do it with normal requests in serial.
+ $this->initializeUsers($users);
}
}
@@ -1933,46 +1932,25 @@ public function initializeUser($user, $password) {
}
/**
- * Make a request about the users to initialize them in parallel.
- * This will be faster than sequential requests to initialize the users.
- * That will force the server to fully initialize the users, including their skeleton files.
+ * Touch an API end-point for each user so that their file-system gets setup
*
* @param array $users
*
* @return void
* @throws \Exception
*/
- public function initializeUserBatch($users) {
+ public function initializeUsers($users) {
$url = "/cloud/users/%s";
- $requests = [];
- $client = new Client();
foreach ($users as $user) {
- // create a new request for each user but do not send it yet.
- // push the newly created request to an array.
- \array_push(
- $requests,
- OcsApiHelper::createOcsRequest(
- $this->getBaseUrl(),
- $user,
- $this->getPasswordForUser($user),
- $method = 'GET',
- \sprintf($url, $user),
- [],
- $client
- )
- );
- }
- // Send all the requests in parallel.
- $response = HttpRequestHelper::sendBatchRequest($requests, $client);
- // throw an exception if any request fails.
- foreach ($response->getFailures() as $e) {
- $pathArray = \explode('/', $e->getRequest()->getPath());
- $failedUser = \end($pathArray);
- throw new \Exception(
- __METHOD__
- . " Could not initialize user $failedUser \n"
- . $e->getResponse()->getStatusCode() . "\n" . $e->getResponse()->getBody()
+ $response = OcsApiHelper::sendRequest(
+ $this->getBaseUrl(),
+ $user,
+ $this->getPasswordForUser($user),
+ 'GET',
+ \sprintf($url, $user)
);
+ $this->setResponse($response);
+ $this->theHTTPStatusCodeShouldBe(200);
}
}
diff --git a/tests/acceptance/features/bootstrap/SearchContext.php b/tests/acceptance/features/bootstrap/SearchContext.php
index c7921273a857..343ed143fdb2 100644
--- a/tests/acceptance/features/bootstrap/SearchContext.php
+++ b/tests/acceptance/features/bootstrap/SearchContext.php
@@ -84,20 +84,22 @@ public function userSearchesUsingWebDavAPI(
}
/**
- * @Then file/folder :path in the search result should contain these properties:
+ * @Then file/folder :path in the search result of user :user should contain these properties:
*
* @param string $path
+ * @param string $user
* @param TableNode $properties
*
* @return void
+ * @throws Exception
*/
public function fileOrFolderInTheSearchResultShouldContainProperties(
- $path, TableNode $properties
+ $path, $user, TableNode $properties
) {
$this->featureContext->verifyTableNodeColumns($properties, ['name', 'value']);
$properties = $properties->getHash();
$fileResult = $this->featureContext->findEntryFromPropfindResponse(
- $path
+ $path, $user
);
Assert::assertNotFalse(
$fileResult, "could not find file/folder '$path'"
diff --git a/tests/acceptance/features/bootstrap/ShareesContext.php b/tests/acceptance/features/bootstrap/ShareesContext.php
index 59c0fdd14151..02f0b17cb778 100644
--- a/tests/acceptance/features/bootstrap/ShareesContext.php
+++ b/tests/acceptance/features/bootstrap/ShareesContext.php
@@ -25,7 +25,7 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\Assert;
require_once 'bootstrap.php';
diff --git a/tests/acceptance/features/bootstrap/Sharing.php b/tests/acceptance/features/bootstrap/Sharing.php
index 55c2ceb07de9..f7b039dc9e36 100644
--- a/tests/acceptance/features/bootstrap/Sharing.php
+++ b/tests/acceptance/features/bootstrap/Sharing.php
@@ -23,7 +23,7 @@
*/
use Behat\Gherkin\Node\TableNode;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\Assert;
use TestHelpers\OcsApiHelper;
use TestHelpers\SharingHelper;
@@ -304,7 +304,7 @@ public function userHasCreatedAShareWithSettings($user, $body) {
);
$this->theHTTPStatusCodeShouldBe(
200,
- "Failed HTTP status code for last share for user $user" . ", Response: " . $this->getResponse()
+ "Failed HTTP status code for last share for user $user" . ", Reason: " . $this->getResponse()->getReasonPhrase()
);
}
diff --git a/tests/acceptance/features/bootstrap/TagsContext.php b/tests/acceptance/features/bootstrap/TagsContext.php
index 8bd6b7544836..f8dc43529e84 100644
--- a/tests/acceptance/features/bootstrap/TagsContext.php
+++ b/tests/acceptance/features/bootstrap/TagsContext.php
@@ -23,7 +23,7 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use PHPUnit\Framework\Assert;
use TestHelpers\TagsHelper;
use TestHelpers\WebDavHelper;
diff --git a/tests/acceptance/features/bootstrap/TransferOwnershipContext.php b/tests/acceptance/features/bootstrap/TransferOwnershipContext.php
index 8b4948d2fcfd..17ebd6570714 100644
--- a/tests/acceptance/features/bootstrap/TransferOwnershipContext.php
+++ b/tests/acceptance/features/bootstrap/TransferOwnershipContext.php
@@ -22,7 +22,7 @@
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
require_once 'bootstrap.php';
diff --git a/tests/acceptance/features/bootstrap/TrashbinContext.php b/tests/acceptance/features/bootstrap/TrashbinContext.php
index 82b83a28ae31..527b52366a57 100644
--- a/tests/acceptance/features/bootstrap/TrashbinContext.php
+++ b/tests/acceptance/features/bootstrap/TrashbinContext.php
@@ -23,7 +23,7 @@
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
use PHPUnit\Framework\Assert;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use TestHelpers\HttpRequestHelper;
use TestHelpers\WebDavHelper;
diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php
index a0a57f0c6211..a025abed040c 100644
--- a/tests/acceptance/features/bootstrap/WebDav.php
+++ b/tests/acceptance/features/bootstrap/WebDav.php
@@ -21,11 +21,11 @@
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
-use GuzzleHttp\Message\ResponseInterface;
use GuzzleHttp\Ring\Exception\ConnectException;
use GuzzleHttp\Stream\StreamInterface;
use Guzzle\Http\Exception\BadResponseException;
use PHPUnit\Framework\Assert;
+use Psr\Http\Message\ResponseInterface;
use TestHelpers\OcsApiHelper;
use TestHelpers\OcisHelper;
use TestHelpers\SetupHelper;
@@ -1182,11 +1182,26 @@ public function theFollowingHeadersShouldBeSet(TableNode $table) {
$expectedHeaderValue = $header['value'];
$returnedHeader = $this->response->getHeader($headerName);
$expectedHeaderValue = $this->substituteInLineCodes($expectedHeaderValue);
+
+ if (\is_array($returnedHeader)) {
+ if (empty($returnedHeader)) {
+ throw new \Exception(
+ \sprintf(
+ "Missing expected header '%s'",
+ $headerName
+ )
+ );
+ }
+ $headerValue = $returnedHeader[0];
+ } else {
+ $headerValue = $returnedHeader;
+ }
+
Assert::assertEquals(
$expectedHeaderValue,
- $returnedHeader,
+ $headerValue,
__METHOD__
- . " Expected value for header '$headerName' was '$expectedHeaderValue', but got '$returnedHeader' instead."
+ . " Expected value for header '$headerName' was '$expectedHeaderValue', but got '$headerValue' instead."
);
}
}
@@ -1218,11 +1233,13 @@ public function downloadedContentShouldStartWith($start) {
*/
public function jobStatusValuesShouldMatchRegEx($user, $table) {
$this->verifyTableNodeColumnsCount($table, 2);
- $url = $this->response->getHeader("OC-JobStatus-Location");
+ $headerArray = $this->response->getHeader("OC-JobStatus-Location");
+ $url = $headerArray[0];
$url = $this->getBaseUrlWithoutPath() . $url;
$response = HttpRequestHelper::get($url, $user, $this->getPasswordForUser($user));
- $result = \json_decode($response->getBody()->getContents(), true);
- Assert::assertNotNull($result, "'$response' is not valid JSON");
+ $contents = $response->getBody()->getContents();
+ $result = \json_decode($contents, true);
+ PHPUnit\Framework\Assert::assertNotNull($result, "'$contents' is not valid JSON");
foreach ($table->getTable() as $row) {
$expectedKey = $row[0];
Assert::assertArrayHasKey(
@@ -1419,12 +1436,7 @@ public function checkElementList(
* @return void
*/
public function userUploadsAFileTo($user, $source, $destination) {
- $file = \GuzzleHttp\Stream\Stream::factory(
- \fopen(
- $this->acceptanceTestsDirLocation() . $source,
- 'r'
- )
- );
+ $file = \fopen($this->acceptanceTestsDirLocation() . $source, 'r');
$this->pauseUploadDelete();
$this->response = $this->makeDavRequest(
$user, "PUT", $destination, [], $file
@@ -1691,7 +1703,7 @@ public function theHTTPStatusCodeOfAllUploadResponsesShouldBe($statusCode) {
Assert::assertEquals(
$statusCode,
$response->getStatusCode(),
- 'Response for ' . $response->getEffectiveUrl() . ' did not return expected status code'
+ 'Response did not return expected status code'
);
}
}
@@ -1708,7 +1720,7 @@ public function theHTTPReasonPhraseOfAllUploadResponsesShouldBe($reasonPhrase) {
Assert::assertEquals(
$reasonPhrase,
$response->getReasonPhrase(),
- 'Response for ' . $response->getEffectiveUrl() . ' did not return expected reason phrase'
+ 'Response did not return expected reason phrase'
);
}
}
@@ -1756,12 +1768,12 @@ public function theHTTPStatusCodeOfAllUploadResponsesShouldBeBetween(
Assert::assertGreaterThanOrEqual(
$minStatusCode,
$response->getStatusCode(),
- 'Response for ' . $response->getEffectiveUrl() . ' did not return expected status code'
+ 'Response did not return expected status code'
);
Assert::assertLessThanOrEqual(
$maxStatusCode,
$response->getStatusCode(),
- 'Response for ' . $response->getEffectiveUrl() . ' did not return expected status code'
+ 'Response did not return expected status code'
);
}
}
@@ -1927,10 +1939,9 @@ public function userUploadsFilesWithContentTo(
public function uploadFileWithContent(
$user, $content, $destination
) {
- $file = \GuzzleHttp\Stream\Stream::factory($content);
$this->pauseUploadDelete();
$this->response = $this->makeDavRequest(
- $user, "PUT", $destination, [], $file
+ $user, "PUT", $destination, [], $content
);
$this->lastUploadDeleteTime = \time();
return $this->response->getHeader('oc-fileid');
@@ -2011,14 +2022,13 @@ public function userHasUploadedAFileWithContentTo(
public function userUploadsAFileWithChecksumAndContentTo(
$user, $checksum, $content, $destination
) {
- $file = \GuzzleHttp\Stream\Stream::factory($content);
$this->pauseUploadDelete();
$this->response = $this->makeDavRequest(
$user,
"PUT",
$destination,
['OC-Checksum' => $checksum],
- $file
+ $content
);
$this->lastUploadDeleteTime = \time();
}
@@ -2374,7 +2384,6 @@ public function userUploadsChunkedFile(
$user, $num, $total, $data, $destination
) {
$num -= 1;
- $data = \GuzzleHttp\Stream\Stream::factory($data);
$file = "$destination-chunking-42-$total-$num";
$this->pauseUploadDelete();
$this->response = $this->makeDavRequest(
@@ -2566,7 +2575,6 @@ public function userHasCreatedANewChunkingUploadWithId($user, $id) {
* @return void
*/
public function userUploadsNewChunkFileOfWithToId($user, $num, $data, $id) {
- $data = \GuzzleHttp\Stream\Stream::factory($data);
$destination = "/uploads/$user/$id/$num";
$this->response = $this->makeDavRequest(
$user, 'PUT', $destination, [], $data, "uploads"
@@ -2844,12 +2852,16 @@ public function theFollowingHeadersShouldNotBeSet(TableNode $table) {
foreach ($table->getColumnsHash() as $header) {
$headerName = $header['header'];
$headerValue = $this->response->getHeader($headerName);
- //Note: according to the documentation of getHeader it must return null
- //if the header does not exist, but its returning an empty string
+ //Note: getHeader returns an empty array if the named header does not exist
+ if (isset($headerValue[0])) {
+ $headerValue0 = $headerValue[0];
+ } else {
+ $headerValue0 = '';
+ }
Assert::assertEmpty(
$headerValue,
"header $headerName should not exist " .
- "but does and is set to $headerValue"
+ "but does and is set to $headerValue0"
);
}
}
@@ -2871,7 +2883,8 @@ public function headersShouldMatchRegularExpressions(TableNode $table) {
$expectedHeaderValue, ['preg_quote' => ['/']]
);
- $returnedHeader = $this->response->getHeader($headerName);
+ $returnedHeaders = $this->response->getHeader($headerName);
+ $returnedHeader = $returnedHeaders[0];
Assert::assertNotFalse(
(bool) \preg_match($expectedHeaderValue, $returnedHeader),
"'$expectedHeaderValue' does not match '$returnedHeader'"
@@ -2984,15 +2997,14 @@ public function theDavElementShouldBe($element, $message) {
}
/**
- * @Then /^the (?:propfind|search) result should (not|)\s?contain these (?:files|entries):$/
- *
* @param string $shouldOrNot (not|)
* @param TableNode $expectedFiles
+ * @param string|null $user
*
* @return void
*/
public function propfindResultShouldContainEntries(
- $shouldOrNot, TableNode $expectedFiles
+ $shouldOrNot, TableNode $expectedFiles, $user = null
) {
$this->verifyTableNodeColumnsCount($expectedFiles, 1);
$elementRows = $expectedFiles->getRows();
@@ -3000,7 +3012,8 @@ public function propfindResultShouldContainEntries(
foreach ($elementRows as $expectedFile) {
$fileFound = $this->findEntryFromPropfindResponse(
- $expectedFile[0]
+ $expectedFile[0],
+ $user
);
if ($should) {
Assert::assertNotEmpty(
@@ -3016,6 +3029,23 @@ public function propfindResultShouldContainEntries(
}
}
+ /**
+ * @Then /^the (?:propfind|search) result of user "([^"]*)" should (not|)\s?contain these (?:files|entries):$/
+ *
+ * @param string $user
+ * @param string $shouldOrNot (not|)
+ * @param TableNode $expectedFiles
+ *
+ * @return void
+ */
+ public function thePropfindResultShouldContainEntries(
+ $user, $shouldOrNot, TableNode $expectedFiles
+ ) {
+ $this->propfindResultShouldContainEntries(
+ $shouldOrNot, $expectedFiles, $user
+ );
+ }
+
/**
* @Then the propfind/search result should contain :numFiles files/entries
*
@@ -3055,15 +3085,43 @@ public function propfindResultShouldContainNumEntries($numFiles) {
*
* @return void
*/
- public function theSearchResultOfShouldContainAnyOfTheseEntries(
+ public function theSearchResultShouldContainAnyOfTheseEntries(
$expectedNumber, TableNode $expectedFiles
+ ) {
+ $this->theSearchResultOfUserShouldContainAnyOfTheseEntries(
+ $this->getCurrentUser(),
+ $expectedNumber,
+ $expectedFiles
+ );
+ }
+
+ /**
+ * @Then the propfind/search result of user :user should contain any :expectedNumber of these files/entries:
+ *
+ * @param string $user
+ * @param integer $expectedNumber
+ * @param TableNode $expectedFiles
+ *
+ * @return void
+ */
+ public function theSearchResultOfUserShouldContainAnyOfTheseEntries(
+ $user, $expectedNumber, TableNode $expectedFiles
) {
$this->verifyTableNodeColumnsCount($expectedFiles, 1);
$this->propfindResultShouldContainNumEntries($expectedNumber);
- $elementRows = $expectedFiles->getRowsHash();
- $resultEntries = $this->findEntryFromPropfindResponse();
+ $elementRows = $expectedFiles->getColumn(0);
+ // Remove any "/" from the front (or back) of the expected values passed
+ // into the step. findEntryFromPropfindResponse returns entries without
+ // any leading (or trailing) slash
+ $expectedEntries = \array_map(
+ function ($value) {
+ return \trim($value, "/");
+ },
+ $elementRows
+ );
+ $resultEntries = $this->findEntryFromPropfindResponse(null, $user);
foreach ($resultEntries as $resultEntry) {
- Assert::assertArrayHasKey($resultEntry, $elementRows);
+ Assert::assertContains($resultEntry, $expectedEntries);
}
}
@@ -3072,13 +3130,16 @@ public function theSearchResultOfShouldContainAnyOfTheseEntries(
* and returns found search results if found else returns false
*
* @param string $entryNameToSearch
+ * @param string|null $user
*
* @return string|array|boolean
* string if $entryNameToSearch is given and is found
* array if $entryNameToSearch is not given
* boolean false if $entryNameToSearch is given and is not found
*/
- public function findEntryFromPropfindResponse($entryNameToSearch = null) {
+ public function findEntryFromPropfindResponse(
+ $entryNameToSearch = null, $user = null
+ ) {
//if we are using that step the second time in a scenario e.g. 'But ... should not'
//then don't parse the result again, because the result in a ResponseInterface
if (empty($this->responseXml)) {
@@ -3086,19 +3147,23 @@ public function findEntryFromPropfindResponse($entryNameToSearch = null) {
HttpRequestHelper::parseResponseAsXml($this->response)
);
}
- $fullWebDavPath = \trim(
- \parse_url($this->response->getEffectiveUrl(), PHP_URL_PATH),
- "/"
- ) . "/";
+ if ($user === null) {
+ $user = $this->getCurrentUser();
+ }
+ // trim any leading "/" passed by the caller, we can just match the "raw" name
+ $trimmedEntryNameToSearch = \trim($entryNameToSearch, "/");
+ // topWebDavPath should be something like /remote.php/webdav/ or
+ // /remote.php/dav/files/user0/
+ $topWebDavPath = "/" . $this->getFullDavFilesPath($user) . "/";
$multistatusResults = $this->responseXml["value"];
$results = [];
if ($multistatusResults !== null) {
foreach ($multistatusResults as $multistatusResult) {
$entryPath = $multistatusResult['value'][0]['value'];
- $entryName = \str_replace($fullWebDavPath, "", $entryPath);
+ $entryName = \str_replace($topWebDavPath, "", $entryPath);
$entryName = \rawurldecode($entryName);
- if ($entryNameToSearch === $entryName) {
+ if ($trimmedEntryNameToSearch === $entryName) {
return $multistatusResult;
}
\array_push($results, $entryName);
diff --git a/tests/acceptance/features/bootstrap/WebUISharingContext.php b/tests/acceptance/features/bootstrap/WebUISharingContext.php
index f4ecacdf7278..c5d3dc36ab9d 100644
--- a/tests/acceptance/features/bootstrap/WebUISharingContext.php
+++ b/tests/acceptance/features/bootstrap/WebUISharingContext.php
@@ -24,7 +24,7 @@
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\RawMinkContext;
-use GuzzleHttp\Message\ResponseInterface;
+use Psr\Http\Message\ResponseInterface;
use Page\FilesPage;
use Page\FilesPageElement\SharingDialog;
use Page\FilesPageElement\SharingDialogElement\EditPublicLinkPopup;
diff --git a/tests/acceptance/features/cliLocalStorage/scanLocalStorage.feature b/tests/acceptance/features/cliLocalStorage/scanLocalStorage.feature
index 737874f3ae7b..e38f2abe605d 100644
--- a/tests/acceptance/features/cliLocalStorage/scanLocalStorage.feature
+++ b/tests/acceptance/features/cliLocalStorage/scanLocalStorage.feature
@@ -6,23 +6,25 @@ Feature: Scanning files on local storage
Scenario: Adding a file to local storage and running scan should add files.
Given user "user0" has been created with default attributes and skeleton files
+ And using new DAV path
And the administrator has set the external storage "local_storage" to be never scanned automatically
# issue-33670: Need to re-scan. Config change doesn't come into effect until once scanned
And the administrator has scanned the filesystem for all users
When the administrator creates file "hello1.txt" with content " php :)" in local storage using the testing API
And user "user0" requests "/remote.php/dav/files/user0/local_storage" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should not contain these entries:
+ | /local_storage/hello1.txt |
When the administrator scans the filesystem for all users using the occ command
And the administrator creates file "hello2.txt" with content " php :(" in local storage using the testing API
And user "user0" requests "/remote.php/dav/files/user0/local_storage" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
- But the propfind result should not contain these entries:
- | /hello2.txt |
+ Then the propfind result of user "user0" should contain these entries:
+ | /local_storage/hello1.txt |
+ But the propfind result of user "user0" should not contain these entries:
+ | /local_storage/hello2.txt |
Scenario: Adding a file to local storage and running scan for a specific path should add files for only that path.
Given user "user0" has been created with default attributes and skeleton files
+ And using new DAV path
And the administrator has set the external storage "local_storage" to be never scanned automatically
And user "user0" has created folder "/local_storage/folder1"
And user "user0" has created folder "/local_storage/folder2"
@@ -32,18 +34,18 @@ Feature: Scanning files on local storage
When the administrator creates file "folder1/hello1.txt" with content " php :)" in local storage using the testing API
And the administrator creates file "folder2/hello2.txt" with content " php :(" in local storage using the testing API
And user "user0" requests "/remote.php/dav/files/user0/local_storage/folder1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should not contain these entries:
+ | /local_storage/folder1/hello1.txt |
When user "user0" requests "/remote.php/dav/files/user0/local_storage/folder2" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello2.txt |
+ Then the propfind result of user "user0" should not contain these entries:
+ | /local_storage/folder2/hello2.txt |
When the administrator scans the filesystem in path "/user0/files/local_storage/folder1" using the occ command
And user "user0" requests "/remote.php/dav/files/user0/local_storage/folder1" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should contain these entries:
+ | /local_storage/folder1/hello1.txt |
When user "user0" requests "/remote.php/dav/files/user0/local_storage/folder2" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello2.txt |
+ Then the propfind result of user "user0" should not contain these entries:
+ | /local_storage/folder1/hello2.txt |
@files_sharing-app-required
Scenario Outline: Adding a folder to local storage, sharing with groups and running scan for specific group should add files for users of that group
@@ -51,6 +53,7 @@ Feature: Scanning files on local storage
| username |
| user1 |
| user2 |
+ And using new DAV path
And group "" has been created
And user "user1" has been added to group ""
And user "user2" has been added to group ""
@@ -61,18 +64,18 @@ Feature: Scanning files on local storage
And the administrator has scanned the filesystem for group ""
When the administrator creates file "folder1/hello1.txt" with content " php :)" in local storage using the testing API
And user "user1" requests "/remote.php/dav/files/user1/local_storage/folder1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should not contain these entries:
+ | /local_storage/folder1/hello1.txt |
When user "user2" requests "/remote.php/dav/files/user2/local_storage/folder1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user2" should not contain these entries:
+ | /local_storage/folder1/hello1.txt |
When the administrator scans the filesystem for group "" using the occ command
And user "user1" requests "/remote.php/dav/files/user1/local_storage/folder1" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
- When user "user2" requests "/remote.php/dav/files/user2/folder1" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should contain these entries:
+ | /local_storage/folder1/hello1.txt |
+ When user "user2" requests "/remote.php/dav/files/user2/local_storage/folder1" with "PROPFIND" using basic auth
+ Then the propfind result of user "user2" should contain these entries:
+ | /local_storage/folder1/hello1.txt |
Examples:
| groupname |
| grp1 |
@@ -85,6 +88,7 @@ Feature: Scanning files on local storage
| user2 |
| user3 |
| user4 |
+ And using new DAV path
And group "grp1" has been created
And group "grp2" has been created
And group "grp3" has been created
@@ -110,51 +114,53 @@ Feature: Scanning files on local storage
And the administrator creates file "folder2/hello2.txt" with content " php :)" in local storage "local_storage2" using the testing API
And the administrator creates file "folder3/hello3.txt" with content " php :)" in local storage "local_storage3" using the testing API
And user "user1" requests "/remote.php/dav/files/user1/local_storage1/folder1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should not contain these entries:
+ | /local_storage1/folder1/hello1.txt |
When user "user2" requests "/remote.php/dav/files/user2/local_storage2/folder2" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello2.txt |
+ Then the propfind result of user "user2" should not contain these entries:
+ | /local_storage2/folder2/hello2.txt |
When user "user3" requests "/remote.php/dav/files/user3/local_storage3/folder3" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello3.txt |
+ Then the propfind result of user "user3" should not contain these entries:
+ | /local_storage3/folder3/hello3.txt |
When user "user4" requests "/remote.php/dav/files/user4/local_storage3/folder3" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello3.txt |
+ Then the propfind result of user "user4" should not contain these entries:
+ | /local_storage3/folder3/hello3.txt |
When the administrator scans the filesystem for groups list "grp2,grp3" using the occ command
And user "user1" requests "/remote.php/dav/files/user1/local_storage1/folder1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should not contain these entries:
+ | /local_storage1/folder1/hello1.txt |
When user "user2" requests "/remote.php/dav/files/user2/local_storage2/folder2" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello2.txt |
+ Then the propfind result of user "user2" should contain these entries:
+ | /local_storage2/folder2/hello2.txt |
When user "user3" requests "/remote.php/dav/files/user3/local_storage3/folder3" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello3.txt |
+ Then the propfind result of user "user3" should contain these entries:
+ | /local_storage3/folder3/hello3.txt |
When user "user4" requests "/remote.php/dav/files/user4/local_storage3/folder3" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello3.txt |
+ Then the propfind result of user "user4" should contain these entries:
+ | /local_storage3/folder3/hello3.txt |
Scenario: Deleting a file from local storage and running scan for a specific path should remove the file.
Given user "user0" has been created with default attributes and skeleton files
+ And using new DAV path
And user "user0" has uploaded file "filesForUpload/textfile.txt" to "/local_storage/hello1.txt"
When user "user0" requests "/remote.php/dav/files/user0/local_storage" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should contain these entries:
+ | /local_storage/hello1.txt |
When the administrator deletes file "hello1.txt" in local storage using the testing API
And user "user0" requests "/remote.php/dav/files/user0/local_storage" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should contain these entries:
+ | /local_storage/hello1.txt |
When the administrator scans the filesystem for all users using the occ command
And user "user0" requests "/remote.php/dav/files/user0/local_storage" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should not contain these entries:
+ | /local_storage/hello1.txt |
Scenario: Adding a file on local storage and running file scan for a specific user should add file for only that user
Given these users have been created with default attributes and skeleton files:
| username |
| user0 |
| user1 |
+ And using new DAV path
And the administrator has created the local storage mount "local_storage1"
And the administrator has added user "user0" as the applicable user for the last local storage mount
And the administrator has created the local storage mount "local_storage2"
@@ -165,18 +171,18 @@ Feature: Scanning files on local storage
When the administrator creates file "hello1.txt" with content " php :)" in local storage "local_storage1" using the testing API
And the administrator creates file "hello1.txt" with content " php :)" in local storage "local_storage2" using the testing API
And user "user0" requests "/remote.php/dav/files/user0/local_storage1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should not contain these entries:
+ | /local_storage1/hello1.txt |
When user "user1" requests "/remote.php/dav/files/user1/local_storage2" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should not contain these entries:
+ | /local_storage2/hello1.txt |
When the administrator scans the filesystem for user "user0" using the occ command
And user "user0" requests "/remote.php/dav/files/user0/local_storage1" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user0" should contain these entries:
+ | /local_storage1/hello1.txt |
When user "user1" requests "/remote.php/dav/files/user1/local_storage2" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should not contain these entries:
+ | /local_storage2/hello1.txt |
Scenario: Adding a file on local storage and running file scan for a specific group should add file for only the users of that group
Given these users have been created with default attributes and skeleton files:
@@ -184,6 +190,7 @@ Feature: Scanning files on local storage
| user1 |
| user2 |
| user3 |
+ And using new DAV path
And group "grp1" has been created
And group "grp2" has been created
And user "user1" has been added to group "grp1"
@@ -199,22 +206,22 @@ Feature: Scanning files on local storage
When the administrator creates file "hello1.txt" with content " php :)" in local storage "local_storage1" using the testing API
And the administrator creates file "hello1.txt" with content " php :)" in local storage "local_storage2" using the testing API
And user "user1" requests "/remote.php/dav/files/user1/local_storage1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should not contain these entries:
+ | /local_storage1/hello1.txt |
When user "user2" requests "/remote.php/dav/files/user2/local_storage1" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user2" should not contain these entries:
+ | /local_storage1/hello1.txt |
When user "user3" requests "/remote.php/dav/files/user3/local_storage2" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user3" should not contain these entries:
+ | /local_storage2/hello1.txt |
When the administrator scans the filesystem for group "grp1" using the occ command
And user "user1" requests "/remote.php/dav/files/user1/local_storage1" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user1" should contain these entries:
+ | /local_storage1/hello1.txt |
When user "user2" requests "/remote.php/dav/files/user2/local_storage1" with "PROPFIND" using basic auth
- Then the propfind result should contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user2" should contain these entries:
+ | /local_storage1/hello1.txt |
When user "user3" requests "/remote.php/dav/files/user3/local_storage2" with "PROPFIND" using basic auth
- Then the propfind result should not contain these entries:
- | /hello1.txt |
+ Then the propfind result of user "user3" should not contain these entries:
+ | /local_storage2/hello1.txt |
diff --git a/tests/phpunit-autotest.xml b/tests/phpunit-autotest.xml
index c91391f572d3..ffcc2d82593c 100644
--- a/tests/phpunit-autotest.xml
+++ b/tests/phpunit-autotest.xml
@@ -14,7 +14,6 @@
Settings/
Core/
ocs-provider/
- TestHelpers/Unit
apps.php
diff --git a/vendor-bin/behat/composer.json b/vendor-bin/behat/composer.json
index 12ad8cec052a..61bc19081f4d 100644
--- a/vendor-bin/behat/composer.json
+++ b/vendor-bin/behat/composer.json
@@ -9,7 +9,7 @@
"sensiolabs/behat-page-object-extension": "^2.3",
"symfony/translation": "^4.4",
"sabre/xml": "^2.2",
- "guzzlehttp/guzzle": "^5.3",
+ "guzzlehttp/guzzle": "^6.5",
"phpunit/phpunit": "^7.5",
"zendframework/zend-ldap": "^2.10"
}