/** * Test creating a \Google_Client from JSON service file */ public function testCreateClientFromJSON() { $obj_client = \GDS\Gateway\GoogleAPIClient::createClientFromJson(dirname(__FILE__) . '/base/service.json'); $this->assertInstanceOf('\\Google_Client', $obj_client); $this->assertInstanceOf('\\Google_Auth_OAuth2', $obj_client->getAuth()); }
/** * Create a new MongoDB connection. * * @return \GDS\Gateway\GoogleAPIClient */ protected function createConnection() { // We'll need a Google_Client, use our convenience method $this->googleClient = \GDS\Gateway\GoogleAPIClient::createGoogleClient($this->config['appname'], $this->config['service_email'], base_path() . '/resources/assets/' . $this->config['key_file']); //THE GATEWAY TO USE $this->googleGateway = new \GDS\Gateway\GoogleAPIClient($this->googleClient, $this->config['project_id']); return $this->googleClient; }