You are here

public function YamlFormElementHelperTest::providerGetIgnoredProperties in YAML Form 8

Data provider for testGetIgnoredProperties().

See also

testGetIgnoredProperties()

File

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

Class

YamlFormElementHelperTest
Tests form element utility.

Namespace

Drupal\Tests\yamlform\Unit

Code

public function providerGetIgnoredProperties() {

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

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

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

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