public function BooleanTest::testFieldBoolean in Field Defaults 8
Test updating a boolean.
File
- src/
Tests/ BooleanTest.php, line 15
Class
- BooleanTest
- Tests that defaults are set on boolean fields.
Namespace
Drupal\field_defaults\TestsCode
public function testFieldBoolean() {
$fieldName = $this
->createField();
$this
->setDefaultValues($fieldName);
// Ensure value is checked on any random node.
$this
->drupalGet('node/' . rand(1, 20) . '/edit');
$this
->assertFieldChecked('edit-field-' . $fieldName . '-value');
}