function ImageFieldValidateTest::getFieldSettings

Same name in other branches
  1. 9 core/modules/image/tests/src/Functional/ImageFieldValidateTest.php \Drupal\Tests\image\Functional\ImageFieldValidateTest::getFieldSettings()
  2. 8.9.x core/modules/image/tests/src/Functional/ImageFieldValidateTest.php \Drupal\Tests\image\Functional\ImageFieldValidateTest::getFieldSettings()
  3. 11.x core/modules/image/tests/src/Functional/ImageFieldValidateTest.php \Drupal\Tests\image\Functional\ImageFieldValidateTest::getFieldSettings()

Returns field settings.

Parameters

int[] $min_resolution: The minimum width and height setting.

int[] $max_resolution: The maximum width and height setting.

Return value

array

1 call to ImageFieldValidateTest::getFieldSettings()
ImageFieldValidateTest::testResolution in core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
Tests min/max dimensions settings.

File

core/modules/image/tests/src/Functional/ImageFieldValidateTest.php, line 277

Class

ImageFieldValidateTest
Tests validation functions such as min/max dimensions.

Namespace

Drupal\Tests\image\Functional

Code

protected function getFieldSettings($min_resolution, $max_resolution) {
    return [
        'max_resolution' => $max_resolution['width'] . 'x' . $max_resolution['height'],
        'min_resolution' => $min_resolution['width'] . 'x' . $min_resolution['height'],
        'alt_field' => 0,
    ];
}

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