Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 403]

Radio input form element.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 91 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/behat/form_field/behat_form_checkbox.php

Defines 1 class

behat_form_radio:: (2 methods):
  get_value()
  set_value()


Class: behat_form_radio  - X-Ref

Radio input form field.

Extends behat_form_checkbox as the set_value() behaviour
is the same and it behaves closer to a checkbox than to
a text field.

This form field type can be added to forms as any other
moodle form element, but it does not make sense without
a group of radio inputs, so is hard to find it alone and
detect it by behat_field_manager::get_form_field(), where is useful
is when the default behat_form_field class is being used, it
finds a input[type=radio] and it delegates set_value() and
get_value() to behat_form_radio.

get_value()   X-Ref
Returns the radio input value attribute.

Here we can not extend behat_form_checkbox because
isChecked() does internally a (bool)getValue() and
it is not good for radio buttons.

return: string The value attribute

set_value($value)   X-Ref
Sets the value of a radio

Partially overwriting behat_form_checkbox
implementation as when JS is disabled we
can not check() and we should use setValue()

return: void
param: string $value