You are here

public function IntegerSprintfFormatterTest::fieldFormatterDataProvider in Range 8

Specific formatter settings data provider.

Return value

array Nested arrays of values to check:

  • $settings
  • $from
  • $to
  • $expected_from
  • $expected_to

Overrides FormatterTestBase::fieldFormatterDataProvider

File

tests/src/Kernel/Formatter/IntegerSprintfFormatterTest.php, line 28

Class

IntegerSprintfFormatterTest
Tests the integer formatter.

Namespace

Drupal\Tests\range\Kernel\Formatter

Code

public function fieldFormatterDataProvider() {
  return [
    // Test separate values.
    [
      [],
      1234,
      5678,
      '1234',
      '5678',
    ],
    [
      [
        'format_string' => '%05d',
      ],
      1234,
      5678,
      '01234',
      '05678',
    ],
    // Test combined values.
    [
      [],
      1234,
      1234,
      '1234',
      '1234',
    ],
    [
      [
        'format_string' => '%06d',
      ],
      1234,
      1234,
      '001234',
      '001234',
    ],
  ];
}