MDL-43738 behat: Updating steps definitions and deprecating methods

This commit is contained in:
David Monllao 2014-01-30 14:48:20 +08:00
parent c3f1e9532d
commit a525414125
10 changed files with 254 additions and 118 deletions

View file

@ -41,4 +41,5 @@ require_once(__DIR__ . '/behat_form_group.php');
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_form_date_selector extends behat_form_group {}
class behat_form_date_selector extends behat_form_group {
}

View file

@ -38,4 +38,5 @@ require_once(__DIR__ . '/behat_form_date_selector.php');
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_form_date_time_selector extends behat_form_date_selector {}
class behat_form_date_time_selector extends behat_form_date_selector {
}

View file

@ -38,4 +38,5 @@ require_once(__DIR__ . '/behat_form_field.php');
* @copyright 2014 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_form_group extends behat_form_field {}
class behat_form_group extends behat_form_field {
}

View file

@ -124,7 +124,7 @@ class behat_form_select extends behat_form_field {
// Single select sometimes needs an extra click in the option.
if (!$multiple) {
// $options only contains 1 option.
// Var $options only contains 1 option.
$optionxpath = $this->get_option_xpath(end($options), $selectxpath);
// Using the driver direcly because Element methods are messy when dealing
@ -297,14 +297,14 @@ class behat_form_select extends behat_form_field {
// If the select is multiple, text commas must be encoded.
$selectedoptions[] = trim(str_replace(',', '\,', $option->{$method}()));
} else {
$selectedoptions[] = trim($option->{$method}());
$selectedoptions[] = trim($option->{$method}());
}
}
}
// Goutte does not keep the 'selected' attribute updated, but its getValue() returns
// the selected elements correctly, also those having commas within them.
} else {
// Goutte does not keep the 'selected' attribute updated, but its getValue() returns
// the selected elements correctly, also those having commas within them.
// Goutte returns the values as an array or as a string depending
// on whether multiple options are selected or not.
@ -322,7 +322,7 @@ class behat_form_select extends behat_form_field {
// If the select is multiple, text commas must be encoded.
$selectedoptions[] = trim(str_replace(',', '\,', $option->{$method}()));
} else {
$selectedoptions[] = trim($option->{$method}());
$selectedoptions[] = trim($option->{$method}());
}
}
}