You are here

public function MockConfig::createFromStorageRecord in Configuration Update Manager 8

Mocks the createFromStorageRecord() method from entity storage.

File

tests/src/Unit/ConfigUpdateUnitTestBase.php, line 512

Class

MockConfig
Mock class for mutable configuration, config entity, and entity storage.

Namespace

Drupal\Tests\config_update\Unit

Code

public function createFromStorageRecord($values) {
  if (!$this->entityPrefix) {
    return NULL;
  }

  // This is supposed to return an entity, but the only method we need is
  // save(), so instead set up and return this object.
  $this->name = $this->entityPrefix . '.' . $values['id'];
  $this->value = $values;
  $this->value['_core'] = 'core_for_' . $this->name;
  return $this;
}