You are here

public function YamlFormElementHelperTest::providerRemoveIgnoredProperties in YAML Form 8

Data provider for testRemoveIgnoredProperties().

See also

testRemoveIgnoredProperties()

File

tests/src/Unit/YamlFormElementHelperTest.php, line 85

Class

YamlFormElementHelperTest
Tests form element utility.

Namespace

Drupal\Tests\yamlform\Unit

Code

public function providerRemoveIgnoredProperties() {

  // Nothing removed.
  $tests[] = [
    [
      '#value' => 'text',
    ],
    [
      '#value' => 'text',
    ],
  ];

  // Remove #tree.
  $tests[] = [
    [
      '#tree' => TRUE,
    ],
    [],
  ];

  // Remove #tree and #element_validate.
  $tests[] = [
    [
      '#tree' => TRUE,
      '#value' => 'text',
      '#element_validate' => 'some_function',
    ],
    [
      '#value' => 'text',
    ],
  ];

  // Remove #subelement__tree and #subelement__element_validate.
  $tests[] = [
    [
      '#subelement__tree' => TRUE,
      '#value' => 'text',
      '#subelement__element_validate' => 'some_function',
    ],
    [
      '#value' => 'text',
    ],
  ];
  return $tests;
}