diff options
author | Joas Schilling <coding@schilljs.com> | 2022-03-21 14:40:45 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-03-21 20:00:51 +0300 |
commit | 56e4f85badb296d4dbd61614850237b7f1503a6b (patch) | |
tree | 854a607d58a27249bc07fb3108b68184832ab594 | |
parent | 6c6c7d7b8a1ca189ae79d202436a4af7312ea2b6 (diff) |
Only check the share_with_link for talk shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | tests/integration/features/bootstrap/SharingContext.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/integration/features/bootstrap/SharingContext.php b/tests/integration/features/bootstrap/SharingContext.php index d8eb2295a..44e9078fe 100644 --- a/tests/integration/features/bootstrap/SharingContext.php +++ b/tests/integration/features/bootstrap/SharingContext.php @@ -597,9 +597,14 @@ class SharingContext implements Context { 'file_source' => 'A_NUMBER', 'file_parent' => 'A_NUMBER', 'mail_send' => '0', - 'share_with_link' => 'URL', ]; - $expectedFields = array_merge($defaultExpectedFields, $body->getRowsHash()); + + $fields = $body->getRowsHash(); + if (isset($fields['share_type']) && ($fields['share_type'] === '10' || $fields['share_type'] === '11')) { + $defaultExpectedFields['share_with_link'] = 'URL'; + } + + $expectedFields = array_merge($defaultExpectedFields, $fields); if (!array_key_exists('uid_file_owner', $expectedFields) && array_key_exists('uid_owner', $expectedFields)) { @@ -621,8 +626,13 @@ class SharingContext implements Context { } } - if ($expectedFields['share_with_link'] === 'URL') { - $expectedFields['share_with_link'] = $this->baseUrl . 'index.php/call/' . $expectedFields['share_with']; + if (array_key_exists('share_with_link', $expectedFields) && + $expectedFields['share_with_link'] === 'URL') { + if (array_key_exists('share_with', $expectedFields)) { + $expectedFields['share_with_link'] = $this->baseUrl . 'index.php/call/' . $expectedFields['share_with']; + } else { + $expectedFields['share_with_link'] = 'REGEXP ' . '/\/call\//'; + } } foreach ($expectedFields as $field => $value) { |