function PrivateKeyTest::testGetNoState

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testGetNoState()
  2. 10 core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testGetNoState()
  3. 9 core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testGetNoState()
  4. 8.9.x core/tests/Drupal/Tests/Core/PrivateKeyTest.php \Drupal\Tests\Core\PrivateKeyTest::testGetNoState()

Tests PrivateKey::get() with no private key from state.

File

core/tests/Drupal/Tests/Core/PrivateKeyTest.php, line 51

Class

PrivateKeyTest
Tests the PrivateKey class.

Namespace

Drupal\Tests\Core

Code

public function testGetNoState() : void {
  $privateKey = new PrivateKey($this->createStub(StateInterface::class));
  $this->assertIsString($privateKey->get());
}

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