Beispiel #1
0
 /**
  * Constructor
  *
  * @param Credentials $credentials
  */
 public function __construct(Credentials $credentials)
 {
     // Make sure we always have the app_id parameter as default
     parent::__construct('', array('command.params' => array('app_id' => $credentials->getAppId())));
     $this->credentials = $credentials;
     $this->setDescription(ServiceDescription::factory(sprintf(__DIR__ . '/ServiceDescription/Pusher-%s.php', self::LATEST_API_VERSION)));
     // Prefix the User-Agent by SDK version
     $this->setUserAgent('zfr-pusher-php/' . Version::VERSION, true);
     // Add a listener to sign each requests
     $this->signature = new PusherSignature();
     $this->addSubscriber(new SignatureListener($credentials, $this->signature));
 }
 /**
  * @covers PusherClient::__construct
  */
 public function testAssertApplicationIdIsAlwaysSent()
 {
     $config = $this->client->getConfig('command.params');
     $this->assertEquals($config['app_id'], $this->credentials->getAppId());
 }