public function testConstruction()
 {
     $certificate = new Certificate(__DIR__ . '/../resources/certificate_corrupt.pem', null, false, Certificate::ENDPOINT_ENV_PRODUCTION);
     $message = Message::builder()->setDeviceToken('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')->setCertificate($certificate)->build();
     $this->assertInstanceOf('\\Wrep\\Notificato\\Apns\\Message', $message, 'Message of incorrect classtype.');
     $this->assertEquals('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', $message->getDeviceToken(), 'Incorrect token retrieved.');
 }
Beispiel #2
0
 /**
  * Create a Message builder
  *
  * @return Apns\MessageBuilder
  */
 public function messageBuilder()
 {
     $builder = Apns\Message::builder();
     if ($this->certificateFactory->getDefaultCertificate() != null) {
         $builder->setCertificate($this->certificateFactory->getDefaultCertificate());
     }
     return $builder;
 }