function UniqueFieldConstraintTest::providerTestEntityWithStringIdWithViolation
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php \Drupal\KernelTests\Core\Validation\UniqueFieldConstraintTest::providerTestEntityWithStringIdWithViolation()
- 8.9.x core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php \Drupal\KernelTests\Core\Validation\UniqueFieldConstraintTest::providerTestEntityWithStringIdWithViolation()
- 11.x core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php \Drupal\KernelTests\Core\Validation\UniqueFieldConstraintTest::providerTestEntityWithStringIdWithViolation()
Data provider for ::testEntityWithStringIdWithViolation().
Return value
array An array of test cases.
See also
self::testEntityWithStringIdWithViolation()
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Validation/ UniqueFieldConstraintTest.php, line 108
Class
- UniqueFieldConstraintTest
- Tests the unique field value validation constraint.
Namespace
Drupal\KernelTests\Core\ValidationCode
public static function providerTestEntityWithStringIdWithViolation() {
return [
'without an id' => [
NULL,
],
'zero as integer' => [
0,
],
'zero as string' => [
"0",
],
'non-zero as integer' => [
mt_rand(1, 127),
],
'non-zero as string' => [
(string) mt_rand(1, 127),
],
'alphanumeric' => [
Random::machineName(),
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.