You are here

public static function AllowedValuesConstraintValidatorTest::allowedValueCallback in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php \Drupal\KernelTests\Core\TypedData\AllowedValuesConstraintValidatorTest::allowedValueCallback()
  2. 9 core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php \Drupal\KernelTests\Core\TypedData\AllowedValuesConstraintValidatorTest::allowedValueCallback()

An AllowedValueConstraint callback.

Return value

string[] A list of allowed values.

File

core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php, line 96

Class

AllowedValuesConstraintValidatorTest
Tests AllowedValues validation constraint with both valid and invalid values.

Namespace

Drupal\KernelTests\Core\TypedData

Code

public static function allowedValueCallback() {
  return [
    'a',
    'b',
    'c',
    '1',
  ];
}