You are here

public static function DoubleFieldField::getFieldSettings in Double Field 7.2

Get field settings.

2 calls to DoubleFieldField::getFieldSettings()
DoubleFieldFormattersTestCase::testTextFormats in tests/double_field_formatters.test
Test that content is filtered with appropriate format.
DoubleFieldTestCase::setUp in tests/double_field_test_case.inc
Prepare environment.

File

tests/double_field_field.inc, line 167
The file contains a class that assists to test Double Field field settings.

Class

DoubleFieldField
Helper class to test Double Field field settings.

Code

public static function getFieldSettings($subfield_type) {
  list($subfields['first'], $subfields['second']) = explode('_&_', $subfield_type);
  foreach ($subfields as $subfield => $subfield_type) {
    $sizes = array(
      'tiny',
      'small',
      'medium',
      'normal',
      'big',
    );
    shuffle($sizes);
    $settings[$subfield] = array(
      'type' => $subfield_type,
      'maxlength' => mt_rand(1, 10000),
      'size' => $sizes[0],
      'precision' => mt_rand(10, 32),
      'scale' => mt_rand(0, 10),
    );
  }
  return $settings;
}