You are here

public function S3FileSchemeHandlerTest::testAddAttributes in Acquia Content Hub 8.2

@covers ::addAttributes

File

modules/acquia_contenthub_s3/tests/src/Kernel/S3FileSchemeHandlerTest.php, line 49

Class

S3FileSchemeHandlerTest
Tests the S3FileSchemeHandler.

Namespace

Drupal\Tests\acquia_contenthub_s3\Kernel

Code

public function testAddAttributes() {
  $file = $this
    ->createFileEntity('test.jpg', 's3');
  $event = new CreateCdfEntityEvent($file, []);
  $this->container
    ->get('event_dispatcher')
    ->dispatch(AcquiaContentHubEvents::CREATE_CDF_OBJECT, $event);
  $cdf = $event
    ->getCdf($file
    ->uuid());
  $this
    ->assertCdfAttribute($cdf, 'ach_s3_bucket', 'bucket-name');
  $this
    ->assertCdfAttribute($cdf, 'ach_s3_source', 'a-root-folder');
}