瀏覽代碼

Add integration test for creating folder with colon

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
tags/v12.0.0beta1
Vincent Petry 7 年之前
父節點
當前提交
553883a1f4
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 25 行新增0 行删除
  1. 9
    0
      build/integration/features/bootstrap/WebDav.php
  2. 16
    0
      build/integration/features/webdav-related.feature

+ 9
- 0
build/integration/features/bootstrap/WebDav.php 查看文件

@@ -31,6 +31,7 @@
use GuzzleHttp\Client as GClient;
use GuzzleHttp\Message\ResponseInterface;
use Sabre\DAV\Client as SClient;
use Sabre\DAV\Xml\Property\ResourceType;

require __DIR__ . '/../../vendor/autoload.php';

@@ -328,6 +329,14 @@ trait WebDav {
}

$value = $keys[$key];
if ($value instanceof ResourceType) {
$value = $value->getValue();
if (empty($value)) {
$value = '';
} else {
$value = $value[0];
}
}
if ($value != $expectedValue) {
throw new \Exception("Property \"$key\" found with value \"$value\", expected \"$expectedValue\"");
}

+ 16
- 0
build/integration/features/webdav-related.feature 查看文件

@@ -447,3 +447,19 @@ Feature: webdav-related
And As an "user1"
When User "user1" deletes file "/testfolder/asdf.txt"
Then the HTTP status code should be "204"

Scenario: Creating a folder
Given using old dav path
And user "user0" exists
And user "user0" created a folder "/test_folder"
When as "user0" gets properties of folder "/test_folder" with
|{DAV:}resourcetype|
Then the single response should contain a property "{DAV:}resourcetype" with value "{DAV:}collection"

Scenario: Creating a folder with special chars
Given using old dav path
And user "user0" exists
And user "user0" created a folder "/test_folder:5"
When as "user0" gets properties of folder "/test_folder:5" with
|{DAV:}resourcetype|
Then the single response should contain a property "{DAV:}resourcetype" with value "{DAV:}collection"

Loading…
取消
儲存