function StorageCopyTraitTest::toArray

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php \Drupal\Tests\Core\Config\StorageCopyTraitTest::toArray()
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php \Drupal\Tests\Core\Config\StorageCopyTraitTest::toArray()
  3. 10 core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php \Drupal\Tests\Core\Config\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

1 call to StorageCopyTraitTest::toArray()
StorageCopyTraitTest::testReplaceStorageContents in core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
@covers ::replaceStorageContents

File

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

Class

StorageCopyTraitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21StorageCopyTrait.php/trait/StorageCopyTrait/11.x" title="Utility trait to copy configuration from one storage to another." class="local">\Drupal\Core\Config\StorageCopyTrait</a> @group Config

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.