/** * @dataProvider right * * @expectedException \Fazland\Notifire\Exception\NotificationFailedException * * @param Sms $sms */ public function testNotifyShouldCallSkebbySendReceiveFailingResponseAndThrowNotificationFailedException(Sms $sms) { $skebbySms = SkebbySms::create()->setRecipients($sms->getTo())->setText($sms->getContent()); $response = new Response(self::RESPONSE_FAIL); $this->skebby->send($skebbySms)->shouldBeCalled(); $this->skebby->send($skebbySms)->willReturn([$response]); $this->handler->notify($sms); /** @var Result $result */ foreach ($sms->getResultSet()->all() as $result) { $this->assertTrue(Result::FAIL === $result->getResult()); } }
/** * Get the parameters for the messages->create call * * @param Sms $notification * * @return array */ protected function getData(Sms $notification) { return ['From' => $notification->getFrom() ?: $this->defaultFrom, 'Body' => $notification->getContent()]; }