public function ImageFieldValidateTest::providerTestEmpty in Drupal 9
Same name and namespace in other branches
- 8 core/modules/image/tests/src/Functional/ImageFieldValidateTest.php \Drupal\Tests\image\Functional\ImageFieldValidateTest::providerTestEmpty()
Data provider for ::testEmpty()
Return value
array Test cases.
File
- core/
modules/ image/ tests/ src/ Functional/ ImageFieldValidateTest.php, line 251
Class
- ImageFieldValidateTest
- Tests validation functions such as min/max resolution.
Namespace
Drupal\Tests\image\FunctionalCode
public function providerTestEmpty() {
return [
'optional-single' => [
'field_image',
FALSE,
1,
'files[field_image_0]',
'Article Article with edit-access-allowed image field has been created.',
'Article Article with edit-access-forbidden image field has been created.',
],
'optional-unlimited' => [
'field_image',
FALSE,
FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
'files[field_image_0][]',
'Article Article with edit-access-allowed image field has been created.',
'Article Article with edit-access-forbidden image field has been created.',
],
'optional-multiple-limited' => [
'field_image',
FALSE,
2,
'files[field_image_0][]',
'Article Article with edit-access-allowed image field has been created.',
'Article Article with edit-access-forbidden image field has been created.',
],
'required-single' => [
'field_image',
TRUE,
1,
'files[field_image_0]',
'field_image field is required.',
'field_image field is required.',
],
'required-unlimited' => [
'field_image',
TRUE,
FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
'files[field_image_0][]',
'field_image field is required.',
'field_image field is required.',
],
// @todo Fix this discrepancy in https://www.drupal.org/project/drupal/issues/3011744.
'required-multiple-limited' => [
'field_image',
TRUE,
2,
'files[field_image_0][]',
'This value should not be null.',
'Article Article with edit-access-forbidden image field has been created.',
],
];
}