test: fix tests and issue tags
test: fix properties namespace
This commit is contained in:
@@ -192,33 +192,6 @@ class FavoritesContext implements Context {
|
||||
$this->asUserFileOrFolderShouldBeFavorited($user, $path, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^as the user (?:file|folder|entry) "([^"]*)" should be favorited$/
|
||||
*
|
||||
* @param string $path
|
||||
* @param integer $expectedValue 0|1
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function asTheUserFileOrFolderShouldBeFavorited(string $path, int $expectedValue = 1):void {
|
||||
$this->asUserFileOrFolderShouldBeFavorited(
|
||||
$this->featureContext->getCurrentUser(),
|
||||
$path,
|
||||
$expectedValue
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^as the user (?:file|folder|entry) "([^"]*)" should not be favorited$/
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function asTheUserFileOrFolderShouldNotBeFavorited(string $path):void {
|
||||
$this->asTheUserFileOrFolderShouldBeFavorited($path, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the elements of a proppatch
|
||||
*
|
||||
|
||||
@@ -315,7 +315,7 @@ class FilesVersionsContext implements Context {
|
||||
$user = $this->featureContext->getActualUsername($user);
|
||||
$fileId = $this->featureContext->getFileIdForPath($user, $path);
|
||||
Assert::assertNotNull($fileId, __METHOD__ . " fileid of file $path user $user not found (the file may not exist)");
|
||||
$response = $this->listVersionFolder($user, $fileId, 1, ['getcontentlength']);
|
||||
$response = $this->listVersionFolder($user, $fileId, 1, ['d:getcontentlength']);
|
||||
$responseXml = HttpRequestHelper::getResponseXml(
|
||||
$response,
|
||||
__METHOD__
|
||||
@@ -504,7 +504,7 @@ class FilesVersionsContext implements Context {
|
||||
):ResponseInterface {
|
||||
if (!$properties) {
|
||||
$properties = [
|
||||
'getetag'
|
||||
'd:getetag'
|
||||
];
|
||||
}
|
||||
$user = $this->featureContext->getActualUsername($user);
|
||||
|
||||
@@ -213,15 +213,15 @@ class WebDavPropertiesContext implements Context {
|
||||
$user = $this->featureContext->getActualUsername($user);
|
||||
$properties = [$propertyName];
|
||||
$response = WebDavHelper::propfind(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getUserPassword($user),
|
||||
$path,
|
||||
$properties,
|
||||
$this->featureContext->getStepLineRef(),
|
||||
"0",
|
||||
"files",
|
||||
$this->featureContext->getDavPathVersion()
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getUserPassword($user),
|
||||
$path,
|
||||
$properties,
|
||||
$this->featureContext->getStepLineRef(),
|
||||
"0",
|
||||
"files",
|
||||
$this->featureContext->getDavPathVersion()
|
||||
);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
@@ -248,15 +248,15 @@ class WebDavPropertiesContext implements Context {
|
||||
$namespace => $propertyName
|
||||
];
|
||||
$response = WebDavHelper::propfind(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getUserPassword($user),
|
||||
$path,
|
||||
$properties,
|
||||
$this->featureContext->getStepLineRef(),
|
||||
"0",
|
||||
"files",
|
||||
$this->featureContext->getDavPathVersion()
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getUserPassword($user),
|
||||
$path,
|
||||
$properties,
|
||||
$this->featureContext->getStepLineRef(),
|
||||
"0",
|
||||
"files",
|
||||
$this->featureContext->getDavPathVersion()
|
||||
);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
@@ -645,14 +645,12 @@ class WebDavPropertiesContext implements Context {
|
||||
public function checkResponseContainsProperty(ResponseInterface $response, string $key, string $namespaceString = null): SimpleXMLElement {
|
||||
$xmlPart = $this->featureContext->getResponseXml($response);
|
||||
|
||||
$nsPrefix = "";
|
||||
if ($namespaceString !== null) {
|
||||
$ns = $this->parseNamespace($namespaceString);
|
||||
$xmlPart->registerXPathNamespace(
|
||||
$ns->prefix,
|
||||
$ns->namespace
|
||||
);
|
||||
$nsPrefix = $ns->prefix . ":";
|
||||
}
|
||||
|
||||
$match = $xmlPart->xpath("//d:prop/$key");
|
||||
@@ -661,9 +659,12 @@ class WebDavPropertiesContext implements Context {
|
||||
isset($match[0]),
|
||||
"Cannot find property \"$key\""
|
||||
);
|
||||
|
||||
$property = \explode(":", $key);
|
||||
$propertyName = $property[\count($property) - 1];
|
||||
Assert::assertEquals(
|
||||
$nsPrefix.$match[0]->getName(),
|
||||
$key
|
||||
$match[0]->getName(),
|
||||
$propertyName
|
||||
);
|
||||
return $match[0];
|
||||
}
|
||||
@@ -1176,7 +1177,7 @@ class WebDavPropertiesContext implements Context {
|
||||
$storePath = $path;
|
||||
}
|
||||
$user = $this->featureContext->getActualUsername($user);
|
||||
$propertiesTable = new TableNode([['propertyName'],['getetag']]);
|
||||
$propertiesTable = new TableNode([['propertyName'],['d:getetag']]);
|
||||
$response = $this->getPropertiesOfFolder(
|
||||
$user,
|
||||
$path,
|
||||
@@ -1322,7 +1323,7 @@ class WebDavPropertiesContext implements Context {
|
||||
*/
|
||||
public function getCurrentEtagOfElement(string $path, string $user):string {
|
||||
$user = $this->featureContext->getActualUsername($user);
|
||||
$propertiesTable = new TableNode([['propertyName'],['getetag']]);
|
||||
$propertiesTable = new TableNode([['propertyName'],['d:getetag']]);
|
||||
$response = $this->getPropertiesOfFolder(
|
||||
$user,
|
||||
$path,
|
||||
|
||||
Reference in New Issue
Block a user