mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-24 21:18:19 -05:00
Removed occ related codes
This commit is contained in:
@@ -79,13 +79,6 @@ trait WebDav {
|
||||
|
||||
private $previousAsyncSetting = null;
|
||||
|
||||
private $previousDavSlowdownSetting = null;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $currentDavSlowdownSettingSeconds = 0;
|
||||
|
||||
/**
|
||||
* response content parsed from XML to an array
|
||||
*
|
||||
@@ -573,45 +566,6 @@ trait WebDav {
|
||||
$this->httpRequestTimeout = (int) $timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the :method DAV requests are slowed down by :seconds seconds
|
||||
*
|
||||
* @param string $method
|
||||
* @param int $seconds
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function slowdownDavRequests(string $method, int $seconds):void {
|
||||
if ($this->previousDavSlowdownSetting === null) {
|
||||
$previousDavSlowdownSetting = ['code' => '', 'stdOut' => '', 'stdErr' => '' ]['stdOut'];
|
||||
$this->previousDavSlowdownSetting = \trim($previousDavSlowdownSetting);
|
||||
}
|
||||
OcsApiHelper::sendRequest(
|
||||
$this->getBaseUrl(),
|
||||
$this->getAdminUsername(),
|
||||
$this->getAdminPassword(),
|
||||
"PUT",
|
||||
"/apps/testing/api/v1/davslowdown/$method/$seconds",
|
||||
$this->getStepLineRef()
|
||||
);
|
||||
$this->currentDavSlowdownSettingSeconds = $seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for possible slowed-down DAV requests to finish
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function waitForDavRequestsToFinish():void {
|
||||
if ($this->currentDavSlowdownSettingSeconds > 0) {
|
||||
// There could be a slowed-down request still happening on the server
|
||||
// Wait just-in-case so that we do not accidentally have an effect on
|
||||
// the next scenario.
|
||||
\sleep($this->currentDavSlowdownSettingSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $user
|
||||
* @param string $fileDestination
|
||||
|
||||
Reference in New Issue
Block a user