function StateTest::testSetMultiple

Tests setMultiple() method.

Here we are saving multiple key value pare in one go. Those value will be used in testResetCache() and testSetBeforeGet() functions.

@covers ::setMultiple

File

core/tests/Drupal/Tests/Core/State/StateTest.php, line 260

Class

StateTest
@coversDefaultClass \Drupal\Core\State\State @group State

Namespace

Drupal\Tests\Core\State

Code

public function testSetMultiple() : State {
    $values = [
        'key1' => 'value1',
        'key2' => 'value2',
        'key3' => 'value3',
    ];
    $this->keyValueStorage
        ->expects($this->once())
        ->method('setMultiple')
        ->with($values);
    $this->state
        ->setMultiple($values);
    return $this->state;
}

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