You are here

class MediaTestConstraint in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/tests/modules/media_test_source/src/Plugin/Validation/Constraint/MediaTestConstraint.php \Drupal\media_test_source\Plugin\Validation\Constraint\MediaTestConstraint
  2. 9 core/modules/media/tests/modules/media_test_source/src/Plugin/Validation/Constraint/MediaTestConstraint.php \Drupal\media_test_source\Plugin\Validation\Constraint\MediaTestConstraint

A media test constraint.

Plugin annotation


@Constraint(
  id = "MediaTestConstraint",
  label = @Translation("Media constraint for test purposes.", context = "Validation"),
  type = { "entity", "string" }
)

Hierarchy

  • class \Drupal\media_test_source\Plugin\Validation\Constraint\MediaTestConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of MediaTestConstraint

1 string reference to 'MediaTestConstraint'
MediaSourceTest::testConstraints in core/modules/media/tests/src/Kernel/MediaSourceTest.php
Tests the media item constraints functionality.

File

core/modules/media/tests/modules/media_test_source/src/Plugin/Validation/Constraint/MediaTestConstraint.php, line 16

Namespace

Drupal\media_test_source\Plugin\Validation\Constraint
View source
class MediaTestConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'Inappropriate text.';

}

Members

Namesort descending Modifiers Type Description Overrides
MediaTestConstraint::$message public property The default violation message.