Skip.php

Same filename and directory in other branches
  1. main core/tests/Drupal/TestTools/Attribute/Skip.php

Namespace

Drupal\TestTools\Attribute

File

core/tests/Drupal/TestTools/Attribute/Skip.php

View source
<?php

declare (strict_types=1);
namespace Drupal\TestTools\Attribute;


/**
 * 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.
 *
 * @see \PHPUnit\Framework\Assert::markTestSkipped()
 * @see \Drupal\Tests\DrupalTestCase::skipTestWithAttribute()
 */
class Skip {
  
  /**
   * Constructs a Skip object.
   *
   * @param string $message
   *   (optional) Information about why the test is skipped.
   */
  public function __construct(public readonly string $message = '') {
  }

}

Classes

Title Deprecated Summary
Skip Defines an attribute to mark tests as skipped.

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