public function testThrowExceptionOnSendingMessageWithoutVideo() { $exceptionCaught = false; $this->gdata = new YouTube(); try { $this->gdata->sendVideoMessage('Should fail', null, null, 'foo'); } catch (App\InvalidArgumentException $e) { $exceptionCaught = true; } $this->assertTrue($exceptionCaught, 'Was expecting an exception if ' . 'sending a message without a video'); }