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']); }
/** * Test method for the <tt>create()</tt> function. * * @group PushwooshTest.create */ public function testCreate() { $pushwoosh = Pushwoosh::create(); $this->assertNotNull($pushwoosh); $this->assertNotNull($pushwoosh->getCURLClient()); }
/** * 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']); }