diff --git a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php index 8607304..81ac83d 100644 --- a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php @@ -84,6 +84,9 @@ public function testValidate() { * @dataProvider providerTestValidateParameterTypes */ public function testValidateParameterTypes($token, $value) { + // Ensure that there is a valid token seed on the session. + $ignored_token = $this->generator->get(); + // The following check might throw PHP fatals and notices, so we disable // error assertions. set_error_handler(function () {return TRUE;}); @@ -117,6 +120,9 @@ public function providerTestValidateParameterTypes() { * @expectedException InvalidArgumentException */ public function testInvalidParameterTypes($token, $value = '') { + // Ensure that there is a valid token seed on the session. + $ignored_token = $this->generator->get(); + $this->generator->validate($token, $value); }