class Skip

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/TestTools/Attribute/Skip.php \Drupal\TestTools\Attribute\Skip

Defines an attribute to mark tests as skipped.

Using this attribute to skip tests is preferred instead of Assert::markTestSkipped(). DrupalTestCase::skipTestWithAttribute() will mark tests with this attribute as skipped before Drupal is bootstrapped.

Attributes

#[\Attribute(\Attribute::TARGET_METHOD)]

Hierarchy

  • class \Drupal\TestTools\Attribute\Skip

Expanded class hierarchy of Skip

See also

\PHPUnit\Framework\Assert::markTestSkipped()

\Drupal\Tests\DrupalTestCase::skipTestWithAttribute()

3 files declare their use of Skip
DrupalTestCase.php in core/tests/Drupal/Tests/DrupalTestCase.php
EditorValidationTest.php in core/modules/editor/tests/src/Kernel/EditorValidationTest.php
SettingsTest.php in core/tests/Drupal/Tests/Core/Site/SettingsTest.php

File

core/tests/Drupal/TestTools/Attribute/Skip.php, line 17

Namespace

Drupal\TestTools\Attribute
View source
class Skip {
  
  /**
   * Constructs a Skip object.
   *
   * @param string $message
   *   (optional) Information about why the test is skipped.
   */
  public function __construct(public readonly string $message = '') {
  }

}

Members

Title Sort descending Modifiers Object type Summary
Skip::__construct public function Constructs a Skip object.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.