Use this class to get an instance of TwitterOAuth component.
Inheritance: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\Http\HttpTrait
コード例 #1
0
ファイル: TwitterOAuth.php プロジェクト: Webiny/Framework
 /**
  * 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());
     }
 }
コード例 #2
0
 /**
  * @expectedException \Webiny\Component\TwitterOAuth\TwitterOAuthException
  * @expectedExceptionMessage Unable to read "TwitterOAuth.doesnt exist" configuration.
  */
 public function testGetInstanceException()
 {
     TwitterOAuthLoader::getInstance('doesnt exist');
 }