You are here

public function CspTest::testRemoveInvalid in Content-Security-Policy 8

Test that removing an invalid directive name causes an exception.

@covers ::removeDirective @covers ::isValidDirectiveName @covers ::validateDirectiveName

File

tests/src/Unit/CspTest.php, line 385

Class

CspTest
Test manipulating directives in a policy.

Namespace

Drupal\Tests\csp\Unit

Code

public function testRemoveInvalid() {
  $this
    ->expectException(\InvalidArgumentException::class);
  $policy = new Csp();
  $policy
    ->removeDirective('foo');
}