Пример #1
0
 function it_return_complete_list_of_parameters(Message $message)
 {
     $message->getContent()->willReturn('foo');
     $message->getSound()->willReturn('alarm');
     $message->getTtl()->willReturn(120);
     $message->getImg()->willReturn('foo.png');
     $message->getBadge()->willReturn(9);
     $this->beConstructedWith('test', 'john', $message);
     $this->getQuery()->shouldReturn(['service' => 'test', 'subscriber' => 'john', 'msg' => 'foo', 'sound' => 'alarm', 'badge' => 9, 'ttl' => 120, 'img' => 'foo.png']);
 }
Пример #2
0
 /**
  * Return an array with request param.
  *
  * @return array
  */
 public function getQuery()
 {
     return array_filter(['service' => $this->serviceName, 'subscriber' => is_array($this->subscriber) ? join(',', $this->subscriber) : $this->subscriber, 'msg' => $this->message->getContent(), 'sound' => $this->message->getSound(), 'badge' => $this->message->getBadge(), 'ttl' => $this->message->getTtl(), 'img' => $this->message->getImg()]);
 }