moodle/analytics
Eloy Lafuente (stronk7) 8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00
..
classes MDL-70898 various: private functions can not be declared final 2021-02-15 16:20:06 +01:00
templates MDL-67735 theme_boost: remove bs2 and bs4alpha compatibility css 2020-08-17 08:16:42 +00:00
tests MDL-71036 phpunit: assertContains() now performs strict comparison 2021-03-11 23:04:31 +01:00
lib.php MDL-64786 analytics: Allow renaming models via inplace editable element 2019-04-15 08:22:13 +02:00
upgrade.txt MDL-65284 analytics: Final deprecation get_analysables() 2020-12-16 12:47:52 +01:00