-
Bug
-
Resolution: Fixed
-
Minor
-
4.2, 4.3
-
MOODLE_402_STABLE, MOODLE_403_STABLE
-
MOODLE_402_STABLE
-
This seems to be a "random" error introduced by the tests added @ MDL-68093.
Specially noticeable with Oracle, but any database can be affected potentially, we are getting these here and there:
Link:
1) core\grouplib_test::test_get_user_groups_with_visibility
|
Failed asserting that two arrays are equal.
|
--- Expected
|
+++ Actual
|
@@ @@
|
Array (
|
- 0 => '1'
|
- 1 => '2'
|
- 2 => '3'
|
- 3 => '4'
|
+ 0 => 3
|
+ 1 => 4
|
+ 2 => 1
|
+ 3 => 2
|
)
|
|
/var/www/html/lib/tests/grouplib_test.php:2124
|
/var/www/html/lib/phpunit/classes/advanced_testcase.php:94
|
It's clearly the typical problem of order not being guaranteed by groups_get_user_groups().
And there are two possible approaches to fix it:
- If it's ok to force an ordering to happen, do it (ORDER by id or whatever) in the core function.
- If really the order doesn't matter, then "relax" the test by using assertEqualsCanonicalizing, so only values are tested, irrespectively of the position.
Normally, 90% of times we just follow approach #1, guaranteeing the function returns ordered stuff.
But #2 is also ok if we aren't going to need any specific order ever.
- is a regression caused by
-
MDL-68093 Membership in some groups should be hidden from some roles for FERPA/ADA compliance (data privacy issue)
-
- Closed
-