MDL-43738 behat: Refactoring the field type guesser

The previous behaviour delegates the responsability
of overwriting the 3 public methods to the child
classes, now the field type or moodleform field is
guessed earlier in the execution flow.

Other changes introduced here:
- Fix wrong moodleform detection when there is a form
  in the page but the field we are dealing with is
  not inside it.
- Updating the last week feature files to these new
  step definitions.
- Some coding style changes.
This commit is contained in:
David Monllao 2014-02-27 16:39:25 +08:00
parent decf1e14c8
commit 8aff0eec9d
13 changed files with 223 additions and 93 deletions

View file

@ -89,9 +89,6 @@ class behat_form_radio extends behat_form_checkbox {
* @return bool
*/
public function matches($expectedvalue = false) {
if (trim($expectedvalue) != trim($this->get_value())) {
return false;
}
return true;
return $this->text_matches($expectedvalue);
}
}