@@ -1738,36 +1738,39 @@ public function userRemovesTheLastLinkShareOfSpaceUsingPermissionsEndpointOfGrap
17381738 * @param string $sharer
17391739 * @param string $space
17401740 * @param bool $shouldExist
1741+ * @param bool $federatedShare
17411742 *
17421743 * @return void
17431744 * @throws GuzzleException
17441745 * @throws JsonException
17451746 * @throws Exception
17461747 */
1747- public function checkIfShareExists (string $ share , string $ sharee , string $ sharer , string $ space , bool $ shouldExist = true ): void {
1748+ public function checkIfShareExists (string $ share , string $ sharee , string $ sharer , string $ space , bool $ shouldExist = true , bool $ federatedShare = false ): void {
17481749 $ share = \ltrim ($ share , "/ " );
17491750 if (\strtolower ($ space ) === "personal " ) {
17501751 $ remoteDriveAlias = "personal/ " . \strtolower ($ sharer );
17511752 } else {
17521753 $ remoteDriveAlias = "project/ " . \strtolower ($ space );
17531754 }
17541755
1755- // check share mountpoint
1756- $ response = GraphHelper::getMySpaces (
1757- $ this ->featureContext ->getBaseUrl (),
1758- $ sharee ,
1759- $ this ->featureContext ->getPasswordForUser ($ sharee ),
1760- "" ,
1761- $ this ->featureContext ->getStepLineRef ()
1762- );
1763- $ driveList = HttpRequestHelper::getJsonDecodedResponseBodyContent ($ response )->value ;
1764- $ foundShareMountpoint = false ;
1765- foreach ($ driveList as $ drive ) {
1766- if ($ drive ->driveType === "mountpoint " && $ drive ->name === $ share && $ drive ->root ->remoteItem ->driveAlias === $ remoteDriveAlias ) {
1767- $ foundShareMountpoint = true ;
1756+ if (!$ federatedShare ) {
1757+ // check share mountpoint
1758+ $ response = GraphHelper::getMySpaces (
1759+ $ this ->featureContext ->getBaseUrl (),
1760+ $ sharee ,
1761+ $ this ->featureContext ->getPasswordForUser ($ sharee ),
1762+ "" ,
1763+ $ this ->featureContext ->getStepLineRef ()
1764+ );
1765+ $ driveList = HttpRequestHelper::getJsonDecodedResponseBodyContent ($ response )->value ;
1766+ $ foundShareMountpoint = false ;
1767+ foreach ($ driveList as $ drive ) {
1768+ if ($ drive ->driveType === "mountpoint " && $ drive ->name === $ share && $ drive ->root ->remoteItem ->driveAlias === $ remoteDriveAlias ) {
1769+ $ foundShareMountpoint = true ;
1770+ }
17681771 }
1772+ Assert::assertSame ($ shouldExist , $ foundShareMountpoint , "Share mountpoint ' $ share' was not found in the drives list. " );
17691773 }
1770- Assert::assertSame ($ shouldExist , $ foundShareMountpoint , "Share mountpoint ' $ share' was not found in the drives list. " );
17711774
17721775 // check share in shared-with-me list
17731776 $ response = GraphHelper::getSharesSharedWithMe (
@@ -1808,6 +1811,21 @@ public function userShouldHaveShareSharedByUserFromSpace(string $sharee, string
18081811 $ this ->checkIfShareExists ($ share , $ sharee , $ sharer , $ space , $ shouldOrNot === "should " );
18091812 }
18101813
1814+ /**
1815+ * @Then /^user "([^"]*)" (should|should not) have a federated share "([^"]*)" shared by user "([^"]*)" from space "([^"]*)"$/
1816+ *
1817+ * @param string $sharee
1818+ * @param string $shouldOrNot
1819+ * @param string $share
1820+ * @param string $sharer
1821+ * @param string $space
1822+ *
1823+ * @return void
1824+ */
1825+ public function userShouldOrShouldNotHaveFederatedShareSharedByUserFromSpace (string $ sharee , string $ shouldOrNot , string $ share , string $ sharer , string $ space ): void {
1826+ $ this ->checkIfShareExists ($ share , $ sharee , $ sharer , $ space , $ shouldOrNot === "should " , true );
1827+ }
1828+
18111829 /**
18121830 * @Given /^user "([^"]*)" has shared the following (?:files|folders) from space "([^"]*)" with user "([^"]*)" and role "([^"]*)":$/
18131831 *
0 commit comments