You are here

protected function ImportExportTestBase::normalizeFixtureAndObject in Acquia Content Hub 8.2

Normalize fixture and expected object.

Parameters

array $fixture: Fixture.

array $object: Object.

Return value

array Normalized data.

1 call to ImportExportTestBase::normalizeFixtureAndObject()
ImportExportTestBase::contentEntityImportExport in tests/src/Kernel/ImportExportTestBase.php
Import and export content.

File

tests/src/Kernel/ImportExportTestBase.php, line 578

Class

ImportExportTestBase
Base for testing exports and imports.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

protected function normalizeFixtureAndObject(array $fixture, array $object) : array {
  $list = self::$normalizeList;

  // If the fixture had no value, we should not evaluate the object.
  foreach ($fixture as $key => $value) {
    if (!$value) {
      $list[] = $key;
    }
  }
  foreach ($list as $item) {
    if (isset($fixture[$item])) {
      unset($fixture[$item]);
    }
    if (isset($object[$item])) {
      unset($object[$item]);
    }
  }
  return [
    $fixture,
    $object,
  ];
}