function StateTest::testGetMultipleStaticCache

Tests getMultiple() method.

Here with the help of testGetMultiple() function, testing the multiple key value again.

@covers ::getMultiple

@depends testGetMultiple

Parameters

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

File

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

Class

StateTest
@coversDefaultClass \Drupal\Core\State\State[[api-linebreak]] @group State

Namespace

Drupal\Tests\Core\State

Code

public function testGetMultipleStaticCache(State $state) : void {
  $keys = [
    'key1',
    'key2',
    'key3',
  ];
  $values = [
    'key1' => 'value1',
    'key2' => 'value2',
    'key3' => 'value3',
  ];
  $this->keyValueStorage
    ->expects($this->never())
    ->method('getMultiple');
  $this->assertEquals($values, $state->getMultiple($keys));
}

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