public function testMethodsExistInGetEvents() { $plugin = new Plugin(); foreach ($plugin->getEvents() as $event) { $this->recurseForMethodName($event, $plugin); } $this->assertTrue(is_array($plugin->getEvents())); }
/** * Gets the token used for authentication. * * @return TokenData|null Returns the token if it exists, null if not. */ public function getToken() { $token = new TokenData(); if ($this->oauth2Subscriber instanceof OAuth2Subscriber) { $token = $this->oauth2Subscriber->getTokenData(); } if (!$token->accessToken && $this->cache instanceof Cache && $this->cache->contains('oauth2token')) { $token = unserialize($this->cache->fetch('oauth2token')); } if (!$token->accessToken) { $response = $this->getClient()->get(); // Trigger call to get a token. Don't care about the result. $token = $this->oauth2Subscriber->getTokenData(); } return $token->accessToken ? $token : null; }