Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-09-23 12:57:13 +02:00
Родитель c0ae809e65
Коммит 979c135512
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F72FA5B49FFA96B0
5 изменённых файлов: 23 добавлений и 22 удалений

Просмотреть файл

@ -19,7 +19,8 @@ use OCP\WorkflowEngine\Events\RegisterOperationsEvent;
*/
class FlowRegisterOperationListener implements IEventListener {
public function __construct(
protected readonly Operation $operation) {
protected readonly Operation $operation,
) {
}
public function handle(Event $event): void {

Просмотреть файл

@ -42,7 +42,7 @@ class Operation implements IComplexOperation, ISpecificOperation {
protected readonly File $fileEntity,
protected readonly IMountManager $mountManager,
protected readonly IRootFolder $rootFolder,
protected readonly LoggerInterface $logger
protected readonly LoggerInterface $logger,
) {
}

Просмотреть файл

@ -127,7 +127,7 @@ class FeatureContext implements Context {
$statusCodes = [(int)$statusCode];
}
if (!in_array($this->response->getStatusCode(), $statusCodes, true)) {
throw new \Exception("Expected $statusCode, got ".$this->response->getStatusCode());
throw new \Exception("Expected $statusCode, got " . $this->response->getStatusCode());
}
}

Просмотреть файл

@ -186,7 +186,7 @@ trait WebDav {
*/
public function checkPropForFile($file, $prefix, $prop, $value) {
$elementList = $this->propfindFile($this->currentUser, $file, "<$prefix:$prop/>");
$property = $elementList['/'.$this->getDavFilesPath($this->currentUser).$file][200]["{DAV:}$prop"];
$property = $elementList['/' . $this->getDavFilesPath($this->currentUser) . $file][200]["{DAV:}$prop"];
Assert::assertEquals($property, $value);
}
@ -689,28 +689,28 @@ trait WebDav {
$boundary = 'boundary_azertyuiop';
$body = '';
$body .= '--'.$boundary."\r\n";
$body .= 'X-File-Path: '.$name1."\r\n";
$body .= '--' . $boundary . "\r\n";
$body .= 'X-File-Path: ' . $name1 . "\r\n";
$body .= "X-File-MD5: f6a6263167c92de8644ac998b3c4e4d1\r\n";
$body .= "X-OC-Mtime: 1111111111\r\n";
$body .= 'Content-Length: '.strlen($content1)."\r\n";
$body .= 'Content-Length: ' . strlen($content1) . "\r\n";
$body .= "\r\n";
$body .= $content1."\r\n";
$body .= '--'.$boundary."\r\n";
$body .= 'X-File-Path: '.$name2."\r\n";
$body .= $content1 . "\r\n";
$body .= '--' . $boundary . "\r\n";
$body .= 'X-File-Path: ' . $name2 . "\r\n";
$body .= "X-File-MD5: 87c7d4068be07d390a1fffd21bf1e944\r\n";
$body .= "X-OC-Mtime: 2222222222\r\n";
$body .= 'Content-Length: '.strlen($content2)."\r\n";
$body .= 'Content-Length: ' . strlen($content2) . "\r\n";
$body .= "\r\n";
$body .= $content2."\r\n";
$body .= '--'.$boundary."\r\n";
$body .= 'X-File-Path: '.$name3."\r\n";
$body .= $content2 . "\r\n";
$body .= '--' . $boundary . "\r\n";
$body .= 'X-File-Path: ' . $name3 . "\r\n";
$body .= "X-File-MD5: e86a1cf0678099986a901c79086f5617\r\n";
$body .= "X-File-Mtime: 3333333333\r\n";
$body .= 'Content-Length: '.strlen($content3)."\r\n";
$body .= 'Content-Length: ' . strlen($content3) . "\r\n";
$body .= "\r\n";
$body .= $content3."\r\n";
$body .= '--'.$boundary."--\r\n";
$body .= $content3 . "\r\n";
$body .= '--' . $boundary . "--\r\n";
$stream = fopen('php://temp', 'r+');
fwrite($stream, $body);
@ -720,7 +720,7 @@ trait WebDav {
$options = [
'auth' => [$user, $this->regularUser],
'headers' => [
'Content-Type' => 'multipart/related; boundary='.$boundary,
'Content-Type' => 'multipart/related; boundary=' . $boundary,
'Content-Length' => (string)strlen($body),
],
'body' => $body

Просмотреть файл

@ -8,7 +8,7 @@ if (!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}
require_once __DIR__.'/../../../lib/base.php';
require_once __DIR__ . '/../../../lib/base.php';
if (!class_exists('\PHPUnit\Framework\TestCase')) {
require_once('PHPUnit/Autoload.php');