function StateTest::testSetMultipleBeforeGetMultiple

Tests getMultiple() method.

Here testing the key value right after we setting it with testSetMultiple() function.

@covers ::getMultiple

@depends testSetMultiple

Parameters

\Drupal\Core\State\State $state: The tested state.

File

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

Class

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

Namespace

Drupal\Tests\Core\State

Code

public function testSetMultipleBeforeGetMultiple(State $state) : void {
    $this->assertEquals([
        'key1' => 'value1',
        'key2' => 'value2',
    ], $state->getMultiple([
        'key1',
        'key2',
    ]));
}

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