added test to check share-types property by sharer after sharee is deleted

This commit is contained in:
Prajwol Amatya
2025-04-03 09:25:18 +05:45
parent e9158c9496
commit 4543f3af3f
3 changed files with 76 additions and 5 deletions

View File

@@ -515,9 +515,10 @@ class WebDavPropertiesContext implements Context {
}
/**
* @Then the single response should contain a property :property with a child property :childProperty
* @Then /^the single response should contain a property "([^"]*)" (with|without) a child property "([^"]*)"$/
*
* @param string $property
* @param string $withOrWithout
* @param string $childProperty
*
* @return void
@@ -526,15 +527,23 @@ class WebDavPropertiesContext implements Context {
*/
public function theSingleResponseShouldContainAPropertyWithChildProperty(
string $property,
string $withOrWithout,
string $childProperty
): void {
$xmlPart = HttpRequestHelper::getResponseXml($this->featureContext->getResponse())->xpath(
"//d:prop/$property/$childProperty"
);
Assert::assertTrue(
isset($xmlPart[0]),
"Cannot find property \"$property/$childProperty\""
);
if ($withOrWithout === "with") {
Assert::assertTrue(
isset($xmlPart[0]),
"Cannot find property \"$property/$childProperty\""
);
} else {
Assert::assertFalse(
isset($xmlPart[0]),
"Found property \"$property/$childProperty\""
);
}
}
/**