public function CspTest::testInvalidHashAlgo in Content-Security-Policy 8
Test specifying an invalid hash algorithm.
@covers ::calculateHash
File
- tests/
src/ Unit/ CspTest.php, line 48
Class
- CspTest
- Test manipulating directives in a policy.
Namespace
Drupal\Tests\csp\UnitCode
public function testInvalidHashAlgo() {
$this
->expectException(\InvalidArgumentException::class);
Csp::calculateHash('alert("Hello World");', 'md5');
}