Skip to content

Commit 2f2c0f7

Browse files
committed
get rid of pointless method
1 parent 156ad67 commit 2f2c0f7

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

src/OpenTok/Broadcast.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,4 @@ public function removeStreamFromBroadcast(string $streamId): bool
282282

283283
return false;
284284
}
285-
286-
public function jsonSerialize()
287-
{
288-
return $this->data;
289-
}
290285
}

tests/OpenTokTest/BroadcastTest.php

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use GuzzleHttp\Handler\MockHandler;
66
use GuzzleHttp\HandlerStack;
77
use GuzzleHttp\Middleware;
8-
use OpenTok\Archive;
98
use OpenTok\Broadcast;
109
use OpenTok\Exception\InvalidArgumentException;
1110
use OpenTok\StreamMode;
@@ -15,7 +14,6 @@
1514
class BroadcastTest extends TestCase
1615
{
1716

18-
// Fixtures
1917
protected $broadcastData;
2018
protected $API_KEY;
2119
protected $API_SECRET;
@@ -46,7 +44,9 @@ public function setupBroadcasts($streamMode)
4644
],
4745
'maxDuration' => 5400,
4846
'resolution' => '640x480',
49-
'streamMode' => $streamMode
47+
'streamMode' => $streamMode,
48+
'isAudio' => true,
49+
'isVideo' => true
5050
);
5151

5252
$this->broadcast = new Broadcast($this->broadcastData, array(
@@ -98,8 +98,6 @@ public function testInitializes()
9898
// Arrange
9999
$this->setupOT();
100100
$this->setupBroadcasts(StreamMode::AUTO);
101-
// Act
102-
// Assert
103101
$this->assertInstanceOf(Broadcast::class, $this->broadcast);
104102
}
105103

@@ -180,5 +178,24 @@ public function testCanRemoveStreamFromBroadcast(): void
180178
);
181179
$this->assertTrue($return);
182180
}
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+
}
183200
}
184201

0 commit comments

Comments
 (0)