MDL-60281 behat: remove unnecessary pre-check

These variables are strings, calling count() on string causes warning in PHP7.2
This commit is contained in:
Marina Glancy 2017-10-01 10:48:05 +08:00
parent 9a316f3367
commit 2abb1e888c

View File

@ -141,15 +141,9 @@ class behat_form_select extends behat_form_field {
$values = $this->get_selected_options(false);
$selectedoptionvalues = $this->get_unescaped_options($values);
// Precheck to speed things up.
if (count($expectedoptions) !== count($selectedoptiontexts) ||
count($expectedoptions) !== count($selectedoptionvalues)) {
return false;
}
// We check against string-ordered lists of options.
if ($expectedoptions != $selectedoptiontexts &&
$expectedoptions != $selectedoptionvalues) {
if ($expectedoptions !== $selectedoptiontexts &&
$expectedoptions !== $selectedoptionvalues) {
return false;
}