MDL-65204 phpunit: more isEqual() strict string fixes
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 3 Apr 2019 15:09:05 +0000 (17:09 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 3 Apr 2019 20:08:16 +0000 (22:08 +0200)
commit87f196af93e71cff6e0d5a518fc9ebafa015a378
treedbfd8ea9c7163e4a8890da9f79d85695b421c7ad
parentf3971a2d88a8e5917ca8dd8c3b58084f11d2524f
MDL-65204 phpunit: more isEqual() strict string fixes

This is a followup of 85f47ba, where we were relaxing
the (new since phpunit 7.x) strict (===) isEqual()
comparison for strings. Copying the explanations for
easier understanding.

Link: https://github.com/sebastianbergmann/phpunit/issues/3185
Solution here is one of:
  a) Return to the previous situation, making the comparison
     softer. That can achieved by forcing different types, so
     float == string works.
  b) Changing APIs (both forms and database return strings) to
     perform some conversion to floats. That would make float
     comparison (with floats or strings) to work too.
The patch here follows the a) approach. Changing all the internals
for proper float handling sounds excesive when it has been working
perfectly since ever. So we went the easier route, just getting
rid of the new === comparisons when needed by changing expectation
types to float.
lib/dml/tests/dml_test.php
question/engine/tests/datalib_reporting_queries_test.php
question/type/calculatedsimple/tests/helper.php
question/type/numerical/tests/helper.php
question/type/truefalse/tests/helper.php