You are here

public function YamlFormOptionsHelperTest::providerRange in YAML Form 8

Data provider for testRange().

See also

testRange()

File

tests/src/Unit/YamlFormOptionsHelperTest.php, line 139

Class

YamlFormOptionsHelperTest
Tests form options utility.

Namespace

Drupal\Tests\yamlform\Unit

Code

public function providerRange() {
  $tests[] = [
    [
      '#min' => 1,
      '#max' => 3,
    ],
    [
      1 => 1,
      2 => 2,
      3 => 3,
    ],
  ];
  $tests[] = [
    [
      '#min' => 0,
      '#max' => 6,
      '#step' => 2,
    ],
    [
      0 => 0,
      2 => 2,
      4 => 4,
      6 => 6,
    ],
  ];
  $tests[] = [
    [
      '#min' => 'A',
      '#max' => 'C',
    ],
    [
      'A' => 'A',
      'B' => 'B',
      'C' => 'C',
    ],
  ];
  $tests[] = [
    [
      '#min' => 'a',
      '#max' => 'c',
    ],
    [
      'a' => 'a',
      'b' => 'b',
      'c' => 'c',
    ],
  ];
  $tests[] = [
    [
      '#min' => 1,
      '#max' => 3,
      '#step' => 1,
      '#pad_length' => 2,
      '#pad_str' => 0,
    ],
    [
      '01' => '01',
      '02' => '02',
      '03' => '03',
    ],
  ];
  return $tests;
}