示例#1
0
 /**
  * @expectedException ErrorException
  * @expectedExceptionMessage Failed to create stream socket client to "ssl://somethingthatdoesnotexist:100". php_network_getaddresses: getaddrinfo failed: Name or service not known
  */
 public function testConnectThrowsException()
 {
     $socketClient = new SocketClient($this->certificate, 'somethingthatdoesnotexist', 100);
     $socketClient->write('test');
 }
示例#2
0
 /**
  * Send Payload instance to a given device token.
  *
  * @param string $deviceToken The device token to send payload to.
  * @param \JWage\APNS\Payload $payload The payload to send to device token.
  */
 public function sendPayload($deviceToken, Payload $payload)
 {
     return $this->socketClient->write($this->createApnMessage($deviceToken, $payload)->getBinaryMessage());
 }