function RecipeConfigStorageWrapperTest::testReadFromA

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Recipe/RecipeConfigStorageWrapperTest.php \Drupal\Tests\Core\Recipe\RecipeConfigStorageWrapperTest::testReadFromA()

Validate that we read from storage A first.

File

core/tests/Drupal/Tests/Core/Recipe/RecipeConfigStorageWrapperTest.php, line 103

Class

RecipeConfigStorageWrapperTest
@coversDefaultClass \Drupal\Core\Recipe\RecipeConfigStorageWrapper[[api-linebreak]] @group Recipe

Namespace

Drupal\Tests\Core\Recipe

Code

public function testReadFromA() : void {
  $a = $this->createMock(StorageInterface::class);
  $value = [
    'a_value',
  ];
  $a->expects($this->once())
    ->method('read')
    ->with('a_key')
    ->willReturn($value);
  $b = $this->createMock(StorageInterface::class);
  $b->expects($this->never())
    ->method('read');
  $storage = new RecipeConfigStorageWrapper($a, $b);
  $this->assertSame($value, $storage->read('a_key'));
}

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