diff --git a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php index b115a61..7c512f7 100644 --- a/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php +++ b/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php @@ -155,7 +155,7 @@ protected function assertCacheTags(array $expected_tags, $include_default_tags = * @return bool * TRUE if the assertion succeeded, FALSE otherwise. */ - protected function assertCacheContexts(array $expected_contexts, $message = NULL, $include_default_contexts = TRUE) { + protected function assertCacheContexts(array $expected_contexts, $message = '', $include_default_contexts = TRUE) { if ($include_default_contexts) { $default_contexts = ['languages:language_interface', 'theme']; // Add the user.permission context to the list of default contexts except diff --git a/core/tests/Drupal/Tests/TestRequirementsTrait.php b/core/tests/Drupal/Tests/TestRequirementsTrait.php index 84937ad..2009532 100644 --- a/core/tests/Drupal/Tests/TestRequirementsTrait.php +++ b/core/tests/Drupal/Tests/TestRequirementsTrait.php @@ -32,8 +32,19 @@ protected static function getDrupalRoot() { * Thrown when the requirements are not met, and this test should be * skipped. Callers should not catch this exception. */ - protected function checkRequirements() { - parent::checkRequirements(); + private function checkRequirements() { + if (!$this->name || !\method_exists($this, $this->name)) { + return; + } + + $missingRequirements = Test::getMissingRequirements( + \get_class($this), + $this->name + ); + + if (!empty($missingRequirements)) { + $this->markTestSkipped(\implode(PHP_EOL, $missingRequirements)); + } $root = static::getDrupalRoot();