You are here

protected function RangeBrowserTestBase::getTestFieldStorageSettings in Range 8

Returns test range field storage settings.

Parameters

string $field_type: Range field type. Could be one of the following values: range_integer, range_float or range_decimal.

Return value

array Range field storage settings.

3 calls to RangeBrowserTestBase::getTestFieldStorageSettings()
RangeBrowserTestBase::createRangeField in tests/src/Functional/RangeBrowserTestBase.php
Creates a range field of a given type.
RangeFieldUiTest::getStorageEdit in tests/src/Functional/RangeFieldUiTest.php
Returns storage edit array for a given field type.
RangeFieldUiTest::rangeTestFieldStorageSettings in tests/src/Functional/RangeFieldUiTest.php
Test range field storage settings.

File

tests/src/Functional/RangeBrowserTestBase.php, line 78

Class

RangeBrowserTestBase
Base class for the range module's tests.

Namespace

Drupal\Tests\range\Functional

Code

protected function getTestFieldStorageSettings($field_type = 'range_integer') {
  switch ($field_type) {
    case 'range_integer':
    case 'range_float':
      return [];
    case 'range_decimal':
      return [
        'precision' => 12,
        'scale' => 4,
      ];
  }
}