public function FormTestBase::getInfo in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Form/FormTestBase.php \Drupal\Tests\Core\Form\FormTestBase::getInfo()
A stub method returning properties for the defined element type.
Parameters
string $type: The machine name of an element type plugin.
Return value
array An array with dummy values to be used in tests. Defaults to an empty array.
File
- core/
tests/ Drupal/ Tests/ Core/ Form/ FormTestBase.php, line 292 - Contains \Drupal\Tests\Core\Form\FormTestBase.
Class
- FormTestBase
- Provides a base class for testing form functionality.
Namespace
Drupal\Tests\Core\FormCode
public function getInfo($type) {
$types['hidden'] = [
'#input' => TRUE,
];
$types['token'] = array(
'#input' => TRUE,
);
$types['value'] = array(
'#input' => TRUE,
);
$types['radios'] = array(
'#input' => TRUE,
);
$types['textfield'] = array(
'#input' => TRUE,
);
$types['submit'] = array(
'#input' => TRUE,
'#name' => 'op',
'#is_button' => TRUE,
);
if (!isset($types[$type])) {
$types[$type] = array();
}
return $types[$type];
}