class Skip
Same name and namespace in other branches
- main 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()
2 files declare their use of Skip
- DrupalTestCaseTrait.php in core/
tests/ Drupal/ Tests/ DrupalTestCaseTrait.php - EditorValidationTest.php in core/
modules/ editor/ tests/ src/ Kernel/ EditorValidationTest.php
File
-
core/
tests/ Drupal/ TestTools/ Attribute/ Skip.php, line 17
Namespace
Drupal\TestTools\AttributeView 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.