function RecipeConfigStorageWrapperTest::testLeftSideExists

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

Validate that the first storage checks existence first.

File

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

Class

RecipeConfigStorageWrapperTest
@coversDefaultClass \Drupal\Core\Recipe\RecipeConfigStorageWrapper @group Recipe

Namespace

Drupal\Tests\Core\Recipe

Code

public function testLeftSideExists() : void {
    $a = $this->createMock(StorageInterface::class);
    $a->expects($this->once())
        ->method('exists')
        ->with('a_key')
        ->willReturn(TRUE);
    $b = $this->createMock(StorageInterface::class);
    $b->expects($this->never())
        ->method('exists');
    $storage = new RecipeConfigStorageWrapper($a, $b);
    $this->assertTrue($storage->exists('a_key'));
}

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