protected function TmgmtExtensionSuitTestBase::isFieldChecked in TMGMT Extension Suite 8.3
Same name and namespace in other branches
- 8.2 tests/src/Functional/TmgmtExtensionSuitTestBase.php \Drupal\Tests\tmgmt_extension_suit\Functional\TmgmtExtensionSuitTestBase::isFieldChecked()
Check if checkbox is checked.
Parameters
string $id: Field id.
Return value
bool TRUE if checked FALSE otherwise.
File
- tests/
src/ Functional/ TmgmtExtensionSuitTestBase.php, line 74
Class
- TmgmtExtensionSuitTestBase
- Basic class for tmgmt extension module.
Namespace
Drupal\Tests\tmgmt_extension_suit\FunctionalCode
protected function isFieldChecked($id) {
$elements = $this
->xpath('//input[@id=:id]', [
':id' => $id,
]);
return isset($elements[0]) && !empty($elements[0]['checked']);
}