public function delete($liveInstanceId) { Bitcodin::setApiToken($this->session->api_key); try { LiveStream::delete($liveInstanceId); } catch (\Exception $ex) { echo "<div class='top-buffer'></div><div class='alert alert-danger' role='alert'>" . $ex->getMessage() . "</div>"; } redirect('overview'); }
/** * @test * @depends waitForLiveStream * * @param LiveStream $liveStream * * @throws \Exception */ public function terminateLiveStream(LiveStream $liveStream) { LiveStream::delete($liveStream->id); echo "Waiting until live stream is TERMINATED...\n"; while ($liveStream->status != LiveStream::STATUS_TERMINATED) { sleep(2); $liveStream->update(); if ($liveStream->status == LiveStream::STATUS_ERROR) { echo "ERROR occurred!"; throw new \Exception("Error occurred during Live stream deletion"); } } $this->assertNotEquals($liveStream->status, LiveStream::STATUS_ERROR); $this->assertEquals($liveStream->status, LiveStream::STATUS_TERMINATED); }