You are here

protected function ExportTest::getCdfAttribute in Acquia Content Hub 8.2

Returns CDF Attribute value.

Parameters

\Acquia\ContentHubClient\CDF\CDFObject $cdf: CDF Object.

string $name: Attribute name.

string $langcode: Language code.

Return value

mixed Attribute's value.

9 calls to ExportTest::getCdfAttribute()
ExportTest::validateBaseCdfObject in tests/src/Kernel/ExportTest.php
Performs basic CDF Object validation.
ExportTest::validateFieldCdfObject in tests/src/Kernel/ExportTest.php
Validates field CDF object.
ExportTest::validateFieldStorageCdfObject in tests/src/Kernel/ExportTest.php
Validates field storage CDF object.
ExportTest::validateFileCdfObject in tests/src/Kernel/ExportTest.php
Validates file CDFObject.
ExportTest::validateNodeCdfObject in tests/src/Kernel/ExportTest.php
Validated "node with a text field" CDF object.

... See full list

File

tests/src/Kernel/ExportTest.php, line 2267

Class

ExportTest
Tests entity exports.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

protected function getCdfAttribute(CDFObject $cdf, $name, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED) {
  $attribute = $cdf
    ->getAttribute($name)
    ->getValue();
  if (!isset($attribute[$langcode])) {
    return NULL;
  }
  return $attribute[$langcode];
}