Files
faveo/vendor/zendframework/zendservice-apple-apns/test/Apns/FeedbackClientTest.php
Manish Verma 126fbb0255 Laravel version update
Laravel version update
2018-08-06 18:55:45 +05:30

50 lines
1.4 KiB
PHP

<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Service
*/
namespace ZendServiceTest\Apple\Apns;
use PHPUnit\Framework\TestCase;
use ZendServiceTest\Apple\Apns\TestAsset\FeedbackClient;
/**
* @category ZendService
* @package ZendService_Apple
* @subpackage UnitTests
* @group ZendService
* @group ZendService_Apple
* @group ZendService_Apple_Apns
*/
class FeedbackClientTest extends TestCase
{
public function setUp()
{
$this->apns = new FeedbackClient();
}
protected function setupValidBase()
{
$this->apns->open(FeedbackClient::SANDBOX_URI, __DIR__ . '/TestAsset/certificate.pem');
}
public function testFeedback()
{
$this->setupValidBase();
$time = time();
$token = 'abc123';
$length = strlen($token) / 2;
$this->apns->setReadResponse(pack('NnH*', $time, $length, $token));
$response = $this->apns->feedback();
$this->assertCount(1, $response);
$feedback = array_shift($response);
$this->assertEquals($time, $feedback->getTime());
$this->assertEquals($token, $feedback->getToken());
}
}