protected function setUp()
 {
     parent::setUp();
     $this->componentName = $this->httpClient->getContainer()->getParameter('app_name');
     $this->configuration = $this->getConfiguration();
     try {
         $this->configuration->create();
     } catch (\Exception $e) {
         // sys bucket exists
     }
     // Cleanup
     $sysBucketId = $this->configuration->getSysBucketId();
     $accTables = $this->storageApiClient->listTables($sysBucketId);
     foreach ($accTables as $table) {
         $this->storageApiClient->dropTable($table['id']);
     }
 }
 protected function setUp()
 {
     parent::setUp();
     $container = $this->httpClient->getContainer();
     $this->encryptor = $container->get('syrup.encryptor');
     $this->restApi = $container->get('wr_google_drive.rest_api');
     $this->testCsvPath = __DIR__ . '/data/test.csv';
     $this->configuration = $container->get('wr_google_drive.configuration');
     $this->configuration->setStorageApi($this->storageApiClient);
     try {
         $this->configuration->create();
     } catch (\Exception $e) {
         // bucket exists
     }
     $this->initEnv();
     $this->initApi($this->accessToken, $this->refreshToken);
     // Cleanup
     $sysBucketId = $this->configuration->getSysBucketId();
     $accTables = $this->storageApiClient->listTables($sysBucketId);
     foreach ($accTables as $table) {
         $this->storageApiClient->dropTable($table['id']);
     }
     if ($this->storageApiClient->tableExists($this->tableId)) {
         $this->storageApiClient->dropTable($this->tableId);
     }
     if ($this->storageApiClient->tableExists($this->rsTableId)) {
         $this->storageApiClient->dropTable($this->rsTableId);
     }
     if (!$this->storageApiClient->bucketExists('in.c-wr-google-drive')) {
         $this->storageApiClient->createBucket('wr-google-drive', Client::STAGE_IN, 'Google Drive IN bucket');
     }
     if (!$this->storageApiClient->bucketExists('in.c-wr-google-drive-rs')) {
         $this->storageApiClient->createBucket('wr-google-drive', Client::STAGE_IN, 'Google Drive IN bucket', 'redshift');
     }
     $csvFile = new CsvFile($this->testCsvPath);
     $this->storageApiClient->createTable('in.c-wr-google-drive', 'test', $csvFile);
     $this->storageApiClient->createTable('in.c-wr-google-drive-rs', 'test', $csvFile);
 }
示例#3
0
 protected function setUp()
 {
     parent::setUp();
     $this->elasticsearch = $this->httpClient->getContainer()->get('syrup.elasticsearch.search');
 }