trait S3FileMapTestTrait in Acquia Content Hub 8.2
Provides helper methods for s3 file map table interactions.
@package Drupal\Tests\acquia_contenthub_s3\Kernel
Hierarchy
- trait \Drupal\Tests\acquia_contenthub_s3\Kernel\S3FileMapTestTrait
File
- modules/
acquia_contenthub_s3/ tests/ src/ Kernel/ S3FileMapTestTrait.php, line 12
Namespace
Drupal\Tests\acquia_contenthub_s3\KernelView source
trait S3FileMapTestTrait {
/**
* Clears s3 file map table.
*/
protected function truncateS3FileMap() : void {
\Drupal::database()
->truncate(S3FileMap::TABLE_NAME)
->execute();
}
/**
* Returns every entry from S3FileMap table.
*
* @return array
* Associative array, keyed by file_uuid.
*
* @throws \Exception
*/
protected function fetchAllData() : array {
return \Drupal::database()
->select(S3FileMap::TABLE_NAME, 'acs3')
->fields('acs3')
->execute()
->fetchAllAssoc('file_uuid', \PDO::FETCH_ASSOC);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
S3FileMapTestTrait:: |
protected | function | Returns every entry from S3FileMap table. | |
S3FileMapTestTrait:: |
protected | function | Clears s3 file map table. |