You are here

public function ReadonlyStorageTest::testReadOperations in Config Filter 8.2

Same name and namespace in other branches
  1. 8 src/Tests/ReadonlyStorageTest.php \Drupal\config_filter\Tests\ReadonlyStorageTest::testReadOperations()

Test methods that should be transparent.

@dataProvider readMethodsProvider

File

src/Tests/ReadonlyStorageTest.php, line 39

Class

ReadonlyStorageTest
Tests ReadonlyStorage operations.

Namespace

Drupal\config_filter\Tests

Code

public function testReadOperations($method, $arguments, $returnValue) {
  $source = $this
    ->prophesize(StorageInterface::class);
  $methodProhecy = new MethodProphecy($source, $method, $arguments);
  $methodProhecy
    ->shouldBeCalledTimes(1);
  $methodProhecy
    ->willReturn($returnValue);
  $source
    ->addMethodProphecy($methodProhecy);
  $storage = $this
    ->getStorage($source
    ->reveal());
  $actual = call_user_func_array([
    $storage,
    $method,
  ], $arguments);
  $this
    ->assertEquals($actual, $returnValue);
}