function AllowedValuesConstraintValidatorTest::allowedValueCallback

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php \Drupal\KernelTests\Core\TypedData\AllowedValuesConstraintValidatorTest::allowedValueCallback()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php \Drupal\KernelTests\Core\TypedData\AllowedValuesConstraintValidatorTest::allowedValueCallback()
  3. 10 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 101

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',
    ];
}

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