You are here

class GhostStorageTest in Configuration Split 8

Tests GhostStorage operations.

@group config_split

Hierarchy

  • class \Drupal\config_split\Tests\GhostStorageTest extends \Drupal\config_filter\Tests\ReadonlyStorageTest

Expanded class hierarchy of GhostStorageTest

File

src/Tests/GhostStorageTest.php, line 15

Namespace

Drupal\config_split\Tests
View source
class GhostStorageTest extends ReadonlyStorageTest {

  /**
   * Override the storage decorating.
   *
   * @param \Drupal\Core\Config\StorageInterface $source
   *   The storage to decorate.
   *
   * @return \Drupal\config_split\Config\GhostStorage
   *   The storage to test.
   */
  protected function getStorage(StorageInterface $source) {
    return new GhostStorage($source);
  }

  /**
   * Override the dataprovider for write methods.
   *
   * @dataProvider writeMethodsProvider
   */
  public function testWriteOperations($method, $arguments) {
    $source = $this
      ->prophesize(StorageInterface::class);
    $source
      ->{$method}(Argument::any())
      ->shouldNotBeCalled();
    $storage = $this
      ->getStorage($source
      ->reveal());
    $actual = call_user_func_array([
      $storage,
      $method,
    ], $arguments);
    $this
      ->assertTrue($actual);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GhostStorageTest::getStorage protected function Override the storage decorating.
GhostStorageTest::testWriteOperations public function Override the dataprovider for write methods.