diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-01-04 17:09:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-04 17:09:57 +0100 |
commit | ff782dbfde14a263d73de87641989ccb15c396cf (patch) | |
tree | bc4b78dd30f24f242b7511d4a26ffb3a232f68d9 /tests/integration | |
parent | 7d9db57f9ed3572501987a6398caeac72d6872ac (diff) | |
parent | 0d3a83b7e9d434719c9f046d4caeced42718dd8c (diff) |
Merge pull request #8492 from nextcloud/feature/store-recording
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/features/bootstrap/FeatureContext.php | 36 | ||||
-rw-r--r-- | tests/integration/features/callapi/recording.feature | 7 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 282909770..59a5c654f 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -3084,6 +3084,42 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** + * @When /^user "([^"]*)" store recording file "([^"]*)" in room "([^"]*)" with (\d+)(?: \((v1)\))?$/ + */ + public function userStoreRecordingFileInRoom(string $user, string $file, string $identifier, int $statusCode, string $apiVersion = 'v1'): void { + $this->setCurrentUser($user); + + $sipBridgeSharedSecret = 'the secret'; + $this->setAppConfig('spreed', new TableNode([['sip_bridge_shared_secret', $sipBridgeSharedSecret]])); + $validRandom = md5((string) rand()); + $validChecksum = hash_hmac('sha256', $validRandom . self::$identifierToToken[$identifier], $sipBridgeSharedSecret); + $headers = [ + 'TALK_SIPBRIDGE_RANDOM' => $validRandom, + 'TALK_SIPBRIDGE_CHECKSUM' => $validChecksum, + ]; + $options = [ + 'multipart' => [ + [ + 'name' => 'file', + 'contents' => $file !== 'invalid' ? fopen(__DIR__ . '/../../../..' . $file, 'r') : '', + ], + [ + 'name' => 'owner', + 'contents' => $user, + ], + ], + ]; + $this->sendRequest( + 'POST', + '/apps/spreed/api/' . $apiVersion . '/recording/' . self::$identifierToToken[$identifier] . '/store', + null, + $headers, + $options + ); + $this->assertStatusCode($this->response, $statusCode); + } + + /** * @Then the response error matches with :error */ public function assertResponseErrorMatchesWith(string $error): void { diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature index fe9a78dd1..54dd1606e 100644 --- a/tests/integration/features/callapi/recording.feature +++ b/tests/integration/features/callapi/recording.feature @@ -116,3 +116,10 @@ Feature: callapi/recording And the response error matches with "call" Then user "participant1" starts "audio" recording in room "room1" with 400 (v1) And the response error matches with "call" + + Scenario: Store recording + Given user "participant1" creates room "room1" (v4) + | roomType | 2 | + | roomName | room1 | + And user "participant1" joins room "room1" with 200 (v4) + Then user "participant1" store recording file "/img/join_call.ogg" in room "room1" with 200 (v1) |