function StorageCopyTraitTest::toArray

Get the protected config data out of a MemoryStorage.

Parameters

\Drupal\Core\Config\MemoryStorage $storage: The config storage to extract the data from.

Return value

array The config data as an array.

1 call to StorageCopyTraitTest::toArray()
StorageCopyTraitTest::testReplaceStorageContents in core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
Tests replace storage contents.

File

core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php, line 95

Class

StorageCopyTraitTest
Tests Drupal\Core\Config\StorageCopyTrait.

Namespace

Drupal\Tests\Core\Config

Code

protected static function toArray(MemoryStorage $storage) {
  $reflection = new \ReflectionObject($storage);
  $property = $reflection->getProperty('config');
  return $property->getValue($storage)
    ->getArrayCopy();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.