You are here

protected function S3FileMapperTest::createCdfAttribute in Acquia Content Hub 8.2

Returns a CDFAttribute object using the provided input string.

In case the input is NULL, the return value will be NULL as well.

Parameters

string|null $name: The name and value of the attribute.

Return value

\Acquia\ContentHubClient\CDFAttribute|null The CDFAttribute or NULL.

Throws

\Exception

2 calls to S3FileMapperTest::createCdfAttribute()
S3FileMapperTest::testMapS3File in modules/acquia_contenthub_s3/tests/src/Kernel/S3FileMapperTest.php
@covers ::mapS3File
S3FileMapperTest::testMapS3FileNoBucket in modules/acquia_contenthub_s3/tests/src/Kernel/S3FileMapperTest.php
@covers ::mapS3File @dataProvider mapS3FileDataProvider

File

modules/acquia_contenthub_s3/tests/src/Kernel/S3FileMapperTest.php, line 131

Class

S3FileMapperTest
Tests the S3FileMapper.

Namespace

Drupal\Tests\acquia_contenthub_s3\Kernel

Code

protected function createCdfAttribute(?string $name) : ?CDFAttribute {
  if (is_null($name)) {
    return NULL;
  }
  return new CDFAttribute($name, CDFAttribute::TYPE_STRING, $name);
}