getSender() public method

Get the right sender when the data is passed.
public getSender ( array $infoNotifications, $category = null ) : SendMultiple | SendOne
$infoNotifications array
$category
return SendMultiple | SendOne
Exemplo n.º 1
0
 /** @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);
 }
Exemplo n.º 2
0
 /**
  * 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);
 }