function CryptTest::testHmacBase64Invalid

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/CryptTest.php \Drupal\Tests\Component\Utility\CryptTest::testHmacBase64Invalid()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/CryptTest.php \Drupal\Tests\Component\Utility\CryptTest::testHmacBase64Invalid()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/CryptTest.php \Drupal\Tests\Component\Utility\CryptTest::testHmacBase64Invalid()

Tests the hmacBase64 method with invalid parameters.

@dataProvider providerTestHmacBase64Invalid @covers ::hmacBase64

Parameters

string $data: Data to hash.

string $key: Key to use in hashing process.

File

core/tests/Drupal/Tests/Component/Utility/CryptTest.php, line 64

Class

CryptTest
Tests random byte generation.

Namespace

Drupal\Tests\Component\Utility

Code

public function testHmacBase64Invalid($data, $key) : void {
    $this->expectException('InvalidArgumentException');
    Crypt::hmacBase64($data, $key);
}

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