diff --git a/lib/behat/form_field/behat_form_select.php b/lib/behat/form_field/behat_form_select.php index 6e359fd3f6492..279f52b47d5a7 100644 --- a/lib/behat/form_field/behat_form_select.php +++ b/lib/behat/form_field/behat_form_select.php @@ -141,15 +141,9 @@ public function matches($expectedvalue) { $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; }