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. 10 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 resolution setting.

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

Return value

array

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

File

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

Class

ImageFieldValidateTest
Tests validation functions such as min/max resolution.

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.