You are here

public function KeyAuthTest::testKeyLength in Key auth 8

Test setting for key length.

File

tests/src/Functional/KeyAuthTest.php, line 58

Class

KeyAuthTest
Tests for key authentication provider.

Namespace

Drupal\Tests\key_auth\Functional

Code

public function testKeyLength() {

  // Set the key length to 64.
  $this->keyAuthConfig
    ->set('key_length', 64);
  $this->keyAuthConfig
    ->save();

  // Test the length.
  $this
    ->assertTrue(strlen($this->keyAuth
    ->generateKey()) == 64);
}