@@ -756,7 +756,7 @@ public function testStartsArchive(): void
756
756
$ sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh- ' ;
757
757
758
758
// Act
759
- $ archive = $ this ->opentok ->startArchive ($ sessionId );
759
+ $ archive = $ this ->opentok ->startArchive ($ sessionId, [ ' maxBitrate ' => 2000000 ] );
760
760
761
761
// Assert
762
762
$ this ->assertCount (1 , $ this ->historyContainer );
@@ -779,6 +779,7 @@ public function testStartsArchive(): void
779
779
$ this ->assertEquals ('' , $ archive ->reason );
780
780
$ this ->assertEquals ('started ' , $ archive ->status );
781
781
$ this ->assertEquals (OutputMode::COMPOSED , $ archive ->outputMode );
782
+ $ this ->assertEquals (2000000 , $ archive ->maxBitrate );
782
783
$ this ->assertNull ($ archive ->name );
783
784
$ this ->assertNull ($ archive ->url );
784
785
$ this ->assertTrue ($ archive ->hasVideo );
@@ -1246,7 +1247,38 @@ public function testGetsArchive(): void
1246
1247
$ this ->assertEquals (true , TestHelpers::validateOpenTokAuthHeader ($ this ->API_KEY , $ this ->API_SECRET , $ authString ));
1247
1248
1248
1249
$ this ->assertInstanceOf ('OpenTok\Archive ' , $ archive );
1249
- // TODO: test the properties of the actual archive object
1250
+ }
1251
+
1252
+ public function testGetsArchiveWithMaxBitrate (): void
1253
+ {
1254
+ // Arrange
1255
+ $ this ->setupOTWithMocks ([[
1256
+ 'code ' => 200 ,
1257
+ 'headers ' => [
1258
+ 'Content-Type ' => 'application/json '
1259
+ ],
1260
+ 'path ' => 'v2/project/APIKEY/archive/ARCHIVEID/get '
1261
+ ]]);
1262
+
1263
+ $ archiveId = '063e72a4-64b4-43c8-9da5-eca071daab89 ' ;
1264
+
1265
+ // Act
1266
+ $ archive = $ this ->opentok ->getArchive ($ archiveId );
1267
+
1268
+ // Assert
1269
+ $ this ->assertCount (1 , $ this ->historyContainer );
1270
+
1271
+ $ request = $ this ->historyContainer [0 ]['request ' ];
1272
+ $ this ->assertEquals ('GET ' , strtoupper ($ request ->getMethod ()));
1273
+ $ this ->assertEquals ('/v2/project/ ' .$ this ->API_KEY .'/archive/ ' .$ archiveId , $ request ->getUri ()->getPath ());
1274
+ $ this ->assertEquals ('api.opentok.com ' , $ request ->getUri ()->getHost ());
1275
+ $ this ->assertEquals ('https ' , $ request ->getUri ()->getScheme ());
1276
+
1277
+ $ authString = $ request ->getHeaderLine ('X-OPENTOK-AUTH ' );
1278
+ $ this ->assertEquals (true , TestHelpers::validateOpenTokAuthHeader ($ this ->API_KEY , $ this ->API_SECRET , $ authString ));
1279
+
1280
+ $ this ->assertInstanceOf ('OpenTok\Archive ' , $ archive );
1281
+ $ this ->assertEquals (2000000 , $ archive ->maxBitrate );
1250
1282
}
1251
1283
1252
1284
public function testDeletesArchive (): void
0 commit comments