function PrivateKeyTest::testSet
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testSet()
- 10 core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testSet()
- 9 core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testSet()
- 8.9.x core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testSet()
Tests PrivateKey::setPrivateKey().
File
-
core/
tests/ Drupal/ Tests/ Core/ PrivateKeyTest.php, line 59
Class
- PrivateKeyTest
- Tests the PrivateKey class.
Namespace
Drupal\Tests\CoreCode
public function testSet() : void {
$random_name = $this->randomMachineName();
$state = $this->createMock(StateInterface::class);
$state->expects($this->once())
->method('set')
->with('system.private_key', $random_name)
->willReturn(TRUE);
$privateKey = new PrivateKey($state);
$privateKey->set($random_name);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.