Skip to content

Commit

Permalink
MDL-60281 behat: remove unnecessary pre-check
Browse files Browse the repository at this point in the history
These variables are strings, calling count() on string causes warning in PHP7.2
  • Loading branch information
marinaglancy committed Oct 16, 2017
1 parent 9a316f3 commit 2abb1e8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/behat/form_field/behat_form_select.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2abb1e8

Please sign in to comment.