/** @test */ function it_send_now_a_notification(SenderFactory $senderFactory, DefaultSender $sender, StoreNotification $storeNotification) { $notifications = []; $category = 1; $senderFactory->getSender($notifications, $category)->shouldBeCalled()->willReturn($sender); $sender->send($storeNotification)->shouldBeCalled()->willReturn(1); $this->sendNow($notifications, $category)->shouldReturn(1); }
/** * Send now whatever data passed * * @param array $info * @param $category * @return mixed */ public function sendNow($info, $category = null) { $sender = $this->senderFactory->getSender($info, $category); return $sender->send($this->storeNotification); }