|
5 | 5 | use GuzzleHttp\Handler\MockHandler; |
6 | 6 | use GuzzleHttp\HandlerStack; |
7 | 7 | use GuzzleHttp\Middleware; |
8 | | -use OpenTok\Archive; |
9 | 8 | use OpenTok\Broadcast; |
10 | 9 | use OpenTok\Exception\InvalidArgumentException; |
11 | 10 | use OpenTok\StreamMode; |
|
15 | 14 | class BroadcastTest extends TestCase |
16 | 15 | { |
17 | 16 |
|
18 | | - // Fixtures |
19 | 17 | protected $broadcastData; |
20 | 18 | protected $API_KEY; |
21 | 19 | protected $API_SECRET; |
@@ -46,7 +44,9 @@ public function setupBroadcasts($streamMode) |
46 | 44 | ], |
47 | 45 | 'maxDuration' => 5400, |
48 | 46 | 'resolution' => '640x480', |
49 | | - 'streamMode' => $streamMode |
| 47 | + 'streamMode' => $streamMode, |
| 48 | + 'isAudio' => true, |
| 49 | + 'isVideo' => true |
50 | 50 | ); |
51 | 51 |
|
52 | 52 | $this->broadcast = new Broadcast($this->broadcastData, array( |
@@ -98,8 +98,6 @@ public function testInitializes() |
98 | 98 | // Arrange |
99 | 99 | $this->setupOT(); |
100 | 100 | $this->setupBroadcasts(StreamMode::AUTO); |
101 | | - // Act |
102 | | - // Assert |
103 | 101 | $this->assertInstanceOf(Broadcast::class, $this->broadcast); |
104 | 102 | } |
105 | 103 |
|
@@ -180,5 +178,24 @@ public function testCanRemoveStreamFromBroadcast(): void |
180 | 178 | ); |
181 | 179 | $this->assertTrue($return); |
182 | 180 | } |
| 181 | + |
| 182 | + public function testCannotRemoveStreamFromBroadcastOnAuto(): void |
| 183 | + { |
| 184 | + $this->expectException(InvalidArgumentException::class); |
| 185 | + |
| 186 | + $this->setupOTWithMocks([[ |
| 187 | + 'code' => 200, |
| 188 | + 'headers' => [ |
| 189 | + 'Content-Type' => 'application/json' |
| 190 | + ], |
| 191 | + 'path' => 'v2/project/APIKEY/broadcast/BROADCASTID/get' |
| 192 | + ]]); |
| 193 | + |
| 194 | + $this->setupBroadcasts(StreamMode::AUTO); |
| 195 | + |
| 196 | + $return = $this->broadcast->removeStreamFromBroadcast( |
| 197 | + '5dfds4-asdda4asf4' |
| 198 | + ); |
| 199 | + } |
183 | 200 | } |
184 | 201 |
|
0 commit comments