You are here

public function PrivateFileSchemeHandlerTest::testAddAttributes in Acquia Content Hub 8.2

@covers ::addAttributes

File

tests/src/Kernel/PrivateFileSchemeHandlerTest.php, line 56

Class

PrivateFileSchemeHandlerTest
Tests the Private File Scheme Handler.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

public function testAddAttributes() {
  $file = $this
    ->createFileEntity('test.jpg', 'private');
  $event = new CreateCdfEntityEvent($file, []);
  $this->container
    ->get('event_dispatcher')
    ->dispatch(AcquiaContentHubEvents::CREATE_CDF_OBJECT, $event);
  $cdf = $event
    ->getCdf($file
    ->uuid());
  $this
    ->assertCdfAttribute($cdf, 'file_scheme', 'private');
  $this
    ->assertCdfAttribute($cdf, 'file_uri', $file
    ->getFileUri());
}