예제 #1
0
 /**
  * @param Account $account
  */
 protected function assertAccount(Account $account)
 {
     $this->assertEquals($this->accountId, $account->getAccountId());
     $this->assertEquals($this->accountName, $account->getAccountName());
     $this->assertEquals($this->googleId, $account->getGoogleId());
     $this->assertEquals($this->googleName, $account->getGoogleName());
     $this->assertEquals($this->email, $account->getEmail());
     $this->assertEquals($this->accessToken, $account->getAccessToken());
     $this->assertEquals($this->refreshToken, $account->getRefreshToken());
 }
 /**
  * @param Account $account
  * @return RestApi
  */
 protected function getApi(Account $account)
 {
     /** @var RestApi $googleDriveApi */
     $googleDriveApi = $this->container->get('ex_google_drive.rest_api');
     $googleDriveApi->getApi()->setCredentials($account->getAccessToken(), $account->getRefreshToken());
     $this->extractor = $this->container->get('ex_google_drive.extractor');
     $this->extractor->setConfiguration($this->getConfiguration());
     $this->extractor->setCurrAccountId($account->getAccountId());
     $googleDriveApi->getApi()->setRefreshTokenCallback([$this->extractor, 'refreshTokenCallback']);
     return $googleDriveApi;
 }