@@ -756,7 +756,7 @@ public function testStartsArchive(): void
756756 $ sessionId = '2_MX44NTQ1MTF-flR1ZSBOb3YgMTIgMDk6NDA6NTkgUFNUIDIwMTN-MC43NjU0Nzh- ' ;
757757
758758 // Act
759- $ archive = $ this ->opentok ->startArchive ($ sessionId );
759+ $ archive = $ this ->opentok ->startArchive ($ sessionId, [ ' maxBitrate ' => 2000000 ] );
760760
761761 // Assert
762762 $ this ->assertCount (1 , $ this ->historyContainer );
@@ -779,6 +779,7 @@ public function testStartsArchive(): void
779779 $ this ->assertEquals ('' , $ archive ->reason );
780780 $ this ->assertEquals ('started ' , $ archive ->status );
781781 $ this ->assertEquals (OutputMode::COMPOSED , $ archive ->outputMode );
782+ $ this ->assertEquals (2000000 , $ archive ->maxBitrate );
782783 $ this ->assertNull ($ archive ->name );
783784 $ this ->assertNull ($ archive ->url );
784785 $ this ->assertTrue ($ archive ->hasVideo );
@@ -1246,7 +1247,38 @@ public function testGetsArchive(): void
12461247 $ this ->assertEquals (true , TestHelpers::validateOpenTokAuthHeader ($ this ->API_KEY , $ this ->API_SECRET , $ authString ));
12471248
12481249 $ 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 );
12501282 }
12511283
12521284 public function testDeletesArchive (): void
0 commit comments