/**
  * Method: construct
  * When: credentials file is ok
  * Should: set correct credentials from Json
  */
 public function testConstructCredentialsFileIsOkSetCorrectCredentialsFromJson()
 {
     vfsStreamWrapper::register();
     /** @var vfsStreamDirectory $rootDir */
     $rootDir = vfsStream::newDirectory('rootDir');
     vfsStreamWrapper::setRoot($rootDir);
     /** @var vfsStreamFile $file */
     $file = vfsStream::newFile(self::TEST_TWITTER_CREDENTIALS_FILE);
     $file->open();
     $file->write(self::TEST_VALID_CREDENTIALS_JSON);
     $rootDir->addChild($file);
     $this->sut = new TwitterCredentials(vfsStream::url('rootDir' . DIRECTORY_SEPARATOR . self::TEST_TWITTER_CREDENTIALS_FILE));
     $this->assertEquals('consumerKeyTest', $this->sut->getConsumerKey());
     $this->assertEquals('consumerSecretTest', $this->sut->getConsumerSecret());
     $this->assertEquals('oAuthTokenTest', $this->sut->getOAuthToken());
     $this->assertEquals('oAuthSecretTest', $this->sut->getOAuthSecret());
 }
 /**
  * @param TwitterCredentials $twitterCredentials
  */
 public function __construct(TwitterCredentials $twitterCredentials)
 {
     $this->twitterCredentials = $twitterCredentials;
     $this->twitterOAuth = new TwitterOAuth($twitterCredentials->getConsumerKey(), $twitterCredentials->getConsumerSecret(), $twitterCredentials->getOAuthToken(), $twitterCredentials->getOAuthSecret());
     $this->twitterOAuth->setTimeouts(10, 15);
 }