mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
87f196af93
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.