public function CryptTest::testHmacBase64 in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Component/Utility/CryptTest.php \Drupal\Tests\Component\Utility\CryptTest::testHmacBase64()
Tests HMAC generation.
@dataProvider providerTestHmacBase64 @covers ::hmacBase64
Parameters
string $data: Data to hash.
string $key: Key to use in hashing process.
string $expected_hmac: Expected result from hashing $data using $key.
File
- core/
tests/ Drupal/ Tests/ Component/ Utility/ CryptTest.php, line 57
Class
- CryptTest
- Tests random byte generation.
Namespace
Drupal\Tests\Component\UtilityCode
public function testHmacBase64($data, $key, $expected_hmac) {
$hmac = Crypt::hmacBase64($data, $key);
$this
->assertEquals($expected_hmac, $hmac, 'The correct hmac was not calculated.');
}