@@ -783,7 +783,7 @@ public function testStartsArchive(): void
783783 $ sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh- ' ;
784784
785785 // Act
786- $ archive = $ this ->opentok ->startArchive ($ sessionId );
786+ $ archive = $ this ->opentok ->startArchive ($ sessionId, [ ' maxBitrate ' => 2000000 ] );
787787
788788 // Assert
789789 $ this ->assertCount (1 , $ this ->historyContainer );
@@ -806,6 +806,7 @@ public function testStartsArchive(): void
806806 $ this ->assertEquals ('' , $ archive ->reason );
807807 $ this ->assertEquals ('started ' , $ archive ->status );
808808 $ this ->assertEquals (OutputMode::COMPOSED , $ archive ->outputMode );
809+ $ this ->assertEquals (2000000 , $ archive ->maxBitrate );
809810 $ this ->assertNull ($ archive ->name );
810811 $ this ->assertNull ($ archive ->url );
811812 $ this ->assertTrue ($ archive ->hasVideo );
@@ -1273,7 +1274,38 @@ public function testGetsArchive(): void
12731274 $ this ->assertEquals (true , TestHelpers::validateOpenTokAuthHeader ($ this ->API_KEY , $ this ->API_SECRET , $ authString ));
12741275
12751276 $ this ->assertInstanceOf ('OpenTok\Archive ' , $ archive );
1276- // TODO: test the properties of the actual archive object
1277+ }
1278+
1279+ public function testGetsArchiveWithMaxBitrate (): void
1280+ {
1281+ // Arrange
1282+ $ this ->setupOTWithMocks ([[
1283+ 'code ' => 200 ,
1284+ 'headers ' => [
1285+ 'Content-Type ' => 'application/json '
1286+ ],
1287+ 'path ' => 'v2/project/APIKEY/archive/ARCHIVEID/get '
1288+ ]]);
1289+
1290+ $ archiveId = '063e72a4-64b4-43c8-9da5-eca071daab89 ' ;
1291+
1292+ // Act
1293+ $ archive = $ this ->opentok ->getArchive ($ archiveId );
1294+
1295+ // Assert
1296+ $ this ->assertCount (1 , $ this ->historyContainer );
1297+
1298+ $ request = $ this ->historyContainer [0 ]['request ' ];
1299+ $ this ->assertEquals ('GET ' , strtoupper ($ request ->getMethod ()));
1300+ $ this ->assertEquals ('/v2/project/ ' .$ this ->API_KEY .'/archive/ ' .$ archiveId , $ request ->getUri ()->getPath ());
1301+ $ this ->assertEquals ('api.opentok.com ' , $ request ->getUri ()->getHost ());
1302+ $ this ->assertEquals ('https ' , $ request ->getUri ()->getScheme ());
1303+
1304+ $ authString = $ request ->getHeaderLine ('X-OPENTOK-AUTH ' );
1305+ $ this ->assertEquals (true , TestHelpers::validateOpenTokAuthHeader ($ this ->API_KEY , $ this ->API_SECRET , $ authString ));
1306+
1307+ $ this ->assertInstanceOf ('OpenTok\Archive ' , $ archive );
1308+ $ this ->assertEquals (2000000 , $ archive ->maxBitrate );
12771309 }
12781310
12791311 public function testDeletesArchive (): void
0 commit comments