function SerializedConstraintValidatorTest::provideTestValidate
Provides an array with several serialized and non-serialized values.
Return value
array An array with test scenarios.
File
-
core/
tests/ Drupal/ Tests/ Core/ Validation/ Plugin/ Validation/ Constraint/ SerializedConstraintValidatorTest.php, line 57
Class
- SerializedConstraintValidatorTest
- Tests serialize validator.
Namespace
Drupal\Tests\Core\Validation\Plugin\Validation\ConstraintCode
public static function provideTestValidate() : array {
$data = [];
$data[] = [
serialize(''),
TRUE,
];
$data[] = [
serialize('0'),
TRUE,
];
$data[] = [
serialize('false'),
TRUE,
];
$data[] = [
serialize(0),
TRUE,
];
$data[] = [
serialize(1),
TRUE,
];
$data[] = [
serialize(TRUE),
TRUE,
];
$data[] = [
serialize(FALSE),
TRUE,
];
$data[] = [
'non serialized string',
FALSE,
];
$data[] = [
TRUE,
FALSE,
];
$data[] = [
new \stdClass(),
FALSE,
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.