From 2abb1e888c23eef38e6eefecf3fdaa9955955418 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Sun, 1 Oct 2017 10:48:05 +0800 Subject: [PATCH] MDL-60281 behat: remove unnecessary pre-check These variables are strings, calling count() on string causes warning in PHP7.2 --- lib/behat/form_field/behat_form_select.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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; }