public function testGetAccessToken() { $token = $this->auth->getAccessToken(); $this->assertInternalType('array', $token); $this->assertArrayHasKey('access_token', $token); $this->assertArrayHasKey('id', $token['access_token']); $this->assertArrayHasKey('ttl', $token['access_token']); $this->assertArrayHasKey('userId', $token['access_token']); }
/** * Client constructor. * @param string $host * @param string $version * @param array $guzzleOptions */ public function __construct(Auth $auth, $host, $version = Crowdsdom::DEFAULT_API_VERSION, array $guzzleOptions = []) { $this->auth = $auth; $this->host = $host; $this->version = $version; $stack = HandlerStack::create(); $stack->push($auth->authMiddleware()); $stack->push(static::versionMiddleware($version)); $this->guzzle = new \GuzzleHttp\Client(array_merge(['base_uri' => $host, 'handler' => $stack], $guzzleOptions)); }