function StateTest::testSet

Tests set() method.

Here we are setting the key value so those value can be used in testResetCache() and testSetBeforeGet() functions.

@covers ::set

File

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

Class

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

Namespace

Drupal\Tests\Core\State

Code

public function testSet() : State {
    $this->keyValueStorage
        ->expects($this->once())
        ->method('set')
        ->with('key', 'value');
    $this->state
        ->set('key', 'value');
    return $this->state;
}

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