test: remove duplicate steps
This commit is contained in:
@@ -1138,36 +1138,6 @@ class SharingNgContext implements Context {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^for user "([^"]*)" the space Shares should (not|)\s?contain these (files|entries):$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $shouldOrNot
|
||||
* @param TableNode $table
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function forUserTheSpaceSharesShouldContainTheseEntries(string $user, string $shouldOrNot, TableNode $table): void {
|
||||
$should = $shouldOrNot !== 'not';
|
||||
$rows = $table->getRows();
|
||||
$response = GraphHelper::getSharesSharedWithMe(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user)
|
||||
);
|
||||
$contents = \json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
$fileFound = empty(array_diff(array_map(fn ($row) => trim($row[0], '/'), $rows), array_column($contents['value'], 'name')));
|
||||
|
||||
$assertMessage = $should
|
||||
? "Response does not contain the entry."
|
||||
: "Response does contain the entry but should not.";
|
||||
|
||||
Assert::assertSame($should, $fileFound, $assertMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given user :user has disabled sync of last shared resource
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user