You are here

public function ImageFieldValidateTest::providerTestEmpty in Drupal 8

Same name and namespace in other branches
  1. 9 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 255

Class

ImageFieldValidateTest
Tests validation functions such as min/max resolution.

Namespace

Drupal\Tests\image\Functional

Code

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