function ConditionPluginBaseTest::providerTestValidateConfigurationForm

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Condition/ConditionPluginBaseTest.php \Drupal\Tests\Core\Condition\ConditionPluginBaseTest::providerTestValidateConfigurationForm()

Data provider for testValidateConfigurationForm().

File

core/tests/Drupal/Tests/Core/Condition/ConditionPluginBaseTest.php, line 40

Class

ConditionPluginBaseTest
Tests Drupal\Core\Condition\ConditionPluginBase.

Namespace

Drupal\Tests\Core\Condition

Code

public static function providerTestValidateConfigurationForm() : \Iterator {
  yield 'unchecked checkbox' => [
    0,
    FALSE,
  ];
  yield 'checked checkbox' => [
    1,
    TRUE,
  ];
  yield 'unchecked checkbox as string' => [
    '0',
    FALSE,
  ];
  yield 'checked checkbox as string' => [
    '1',
    TRUE,
  ];
  yield 'empty string' => [
    '',
    FALSE,
  ];
  yield 'boolean false' => [
    FALSE,
    FALSE,
  ];
  yield 'boolean true' => [
    TRUE,
    TRUE,
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.