You are here

public function MockConfig::load in Configuration Update Manager 8

Mocks the load() method for entity storage.

File

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

Class

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

Namespace

Drupal\Tests\config_update\Unit

Code

public function load($id) {
  $full_name = $this->entityPrefix . '.' . $id;
  $configs = $this->test
    ->getConfigStorage();
  if (isset($configs[$full_name])) {
    $this->value = $configs[$full_name];
    $this->name = $full_name;
    $this->value['_core'] = 'core_for_' . $full_name;
    return $this;
  }
  return NULL;
}