Exemplo n.º 1
0
 public function __construct(array $options)
 {
     if (!isset($options['application_id'])) {
         throw new \InvalidArgumentException('Argumento \'application_id\' é requerido.');
     }
     if (!isset($options['access_token'])) {
         throw new \InvalidArgumentException('Argumento \'access_token\' é requerido.');
     }
     $this->wrapper = ClientPush::create()->setApplication($options['application_id'])->setAuth($options['access_token']);
 }
Exemplo n.º 2
0
 /**
  * Test method for the <tt>create()</tt> function.
  *
  * @group PushwooshTest.create
  */
 public function testCreate()
 {
     $pushwoosh = Pushwoosh::create();
     $this->assertNotNull($pushwoosh);
     $this->assertNotNull($pushwoosh->getCURLClient());
 }
Exemplo n.º 3
0
 /**
  * Get the Pushwoosh client.
  *
  * @param string[] $auth
  *
  * @return \Gomoob\Pushwoosh\Client\Pushwoosh
  */
 protected function getClient(array $auth)
 {
     return Pushwoosh::create()->setApplication($auth['app'])->setAuth($auth['token']);
 }