/** * Base constructor. * * @param string $serverName Name of the TwitterOAuth server in the current configuration. * @param string|array $roles Roles that will be set for the OAuth users. * * @throws TwitterOAuthException */ public function __construct($serverName, $roles) { try { $this->connection = TwitterOAuthLoader::getInstance($serverName); $this->oauthRoles = (array) $roles; } catch (\Exception $e) { throw new TwitterOAuthException($e->getMessage()); } }
/** * @expectedException \Webiny\Component\TwitterOAuth\TwitterOAuthException * @expectedExceptionMessage Unable to read "TwitterOAuth.doesnt exist" configuration. */ public function testGetInstanceException() { TwitterOAuthLoader::getInstance('doesnt exist'); }