You are here

public function FieldValueTest::providerTestFieldValue in Twig Field Value 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/FieldValue/FieldValueTest.php \Drupal\Tests\twig_field_value\Unit\FieldValue\FieldValueTest::providerTestFieldValue()

Provides data and expected results for the test method.

Return value

array Data and expected results.

File

tests/src/Unit/FieldValue/FieldValueTest.php, line 78

Class

FieldValueTest
@coversDefaultClass \Drupal\twig_field_value\Twig\Extension\FieldValueExtension @group twig_field_value

Namespace

Drupal\Tests\twig_field_value\Unit\FieldValue

Code

public function providerTestFieldValue() {
  return [
    [
      NULL,
      NULL,
    ],
    [
      NULL,
      [],
    ],
    [
      NULL,
      [
        '#items' => 'foo',
      ],
    ],
    [
      NULL,
      [
        '#theme' => 'item_list',
      ],
    ],
    [
      NULL,
      [
        '#theme' => 'field',
      ],
    ],
    [
      [
        0 => [
          '#markup' => 'this value',
        ],
      ],
      [
        '#theme' => 'field',
        '#items' => [
          0 => 'dummy',
        ],
        0 => [
          '#markup' => 'this value',
        ],
      ],
    ],
    [
      [
        0 => [
          '#markup' => 'zero',
        ],
        2 => [
          '#markup' => 'two',
        ],
        3 => [
          '#markup' => 'three',
        ],
      ],
      [
        '#theme' => 'field',
        '#items' => [
          0 => 'dummy',
          1 => 'dummy',
          2 => 'dummy',
          3 => 'dummy',
        ],
        0 => [
          '#markup' => 'zero',
        ],
        2 => [
          '#markup' => 'two',
        ],
        3 => [
          '#markup' => 'three',
        ],
      ],
    ],
  ];
}