send() публичный Метод

Send notifications Both multiple and single.
public send ( array $info = [] ) : mixed
$info array
Результат mixed
Пример #1
0
 /**
  * @test
  */
 function it_store_extra_field_as_json()
 {
     $this->createCategory(['name' => 'custom']);
     $extra = ['extra.name' => 'amazing'];
     $notifications = $this->notifynder->category('custom')->extra($extra)->url('w')->from(1)->to(1);
     $notifications = $this->notifynder->send($notifications);
     $this->assertEquals($notifications->extra->toArray(), $extra);
 }
Пример #2
0
 /** @test */
 public function it_fire_a_notifynder_event(Dispatcher $dispatcher, NotifynderManager $notifynder)
 {
     $key = 'event';
     $category = 'hello';
     $extraValues = [];
     $notifyEvent = 'Notifynder.' . $key;
     $notificationBuilt = [0 => ['notification']];
     $notifynderEvent = new NotifynderEvent($notifyEvent, $category, $extraValues);
     $dispatcher->fire($notifyEvent, [$notifynderEvent, $notifynder])->shouldBeCalled()->willReturn($notificationBuilt);
     $notifynder->send($notificationBuilt[0])->shouldBeCalled()->willReturn(1);
     $this->fire($notifynder, $key, $category, $extraValues)->shouldReturn(1);
 }