Commit graph

33 commits

Author SHA1 Message Date
Paul Holden
c260bad774 MDL-69908 user: include groups with exported course participants. 2021-06-14 09:31:30 +01:00
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
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Michael Hawkins
03397c817b MDL-68348 lib: User filter match types support - groups
Updated groups_get_members_join to support different filter match types
2020-05-25 18:35:08 +08:00
Michael Hawkins
44e47eff9a MDL-68246 lib: Prepare for participants filter multiple groups support
These function updates are in preparation for the participants_search
class, which will be used to support multiple values per filter when
filtering the participants page.
2020-05-14 15:47:52 +08:00
Shamim Rezaie
cb64dfbeb1 MDL-34411 groups: copy/paste error in test_groups_user_groups_visible 2019-07-02 08:54:36 +02:00
Shamim Rezaie
bc15800927 MDL-64521 groups: add more unit tests
These tests were created for MDL-64526, just before MDL-64521 came along
and removed the buggy code. These are good tests, so they are being
kept.
2019-01-22 16:42:38 +00:00
Sara Arjona
5290d0604b MDL-61967 core_user: Allow filtering by No groups on participants page
A new optional parameter $context has been added to the
core_group::groups_get_members_join() function.
Besides, some core_group methods now accept -1 (USERSWITHOUTHGROUP) for
the groupid field.
2018-09-24 18:33:45 +02:00
Simey Lameze
e2b7dca006 MDL-60826 groups: deprecate groups_get_all_groups_for_courses function 2018-07-24 07:58:35 +08:00
Andrew Nicols
63ce49df9b MDL-59748 groupslib: Fix time issue in unit test 2017-08-08 10:07:46 +08:00
Simey Lameze
705eea84d1 MDL-59382 core: make CiBoT happy. 2017-08-02 07:52:20 +00:00
Ryan Wyllie
aa0912258d MDL-59382 calendar: add modal to create and update events 2017-08-02 04:47:43 +00:00
Damyon Wiese
bfd42c1a88 MDL-59368 groups: More phpunit coverage
Cover $withmembers parameter to groups_get_all_groups with a unit test.
2017-07-12 10:41:32 +08:00
Jun Pataleta
d3679c37af MDL-58563 group: Specify table alias in sort parameter for group test 2017-04-11 12:40:41 +08:00
Juan Leyva
8c60d198c2 MDL-57411 groups: Fix tests for MSSQL 2017-04-05 13:17:46 +02:00
Juan Leyva
a7d9c5373e MDL-57411 groups: New helper functions
- groups_get_groups_members
- groups_get_activity_shared_group_members
2017-03-31 09:04:58 +02:00
John Beedell
905953909f MDL-31243 access/enrol libs: rename new groups functions 2016-09-30 09:27:59 +01:00
John Beedell
9121bb2d23 MDL-31243 access/enrol libs: new fns returning useful SQL fragments
Refactor similar SQL generation code from get_users_by_capability
and get_enrolled_uses to make get_with_capability_sql.
Modified files: accesslib.php, enrollib.php, grouplib.php, new tests.
2016-09-30 09:27:56 +01:00
Juan Leyva
aa5faf0070 MDL-49314 groups: Unit tests for groups_user_groups_visible 2015-04-01 10:19:26 +02:00
Jason Platts
a75a381f04 MDL-48437 Make Visible/All groups selector show own groups first 2015-02-18 09:32:23 +00:00
Simey Lameze
a0372a4019 MDL-44794 group: unit test for groups_get_user_groups method. 2014-08-04 11:59:06 +08:00
sam marshall
4c31243fc7 MDL-43252 Group menu in wrong order when groupings used 2013-12-09 13:02:12 +00:00
Aaron Barnes
2eaa440c34 MDL-42913 lib/grouplib.php: Avoid cache sometimes for groups_get_all_groups
The new groups cache returns unexpected results when you pass
in a field parameter than would normally change the result array index
2013-11-20 11:56:42 +13:00
Ankit Agarwal
ef9ca10699 MDL-21415 reports: We should fetch active group from session not page params
Also donot allow active group to be set to something that user doesn't have access to
2013-09-12 11:18:25 +08:00
Ankit Agarwal
28c4399b6b MDL-21415 reports: Adding support of groups to course participation reports
Also introducing new api groups_allgroups_course_menu() that generates a selector for all groups in course"
2013-09-10 13:14:33 +08:00
Sam Hemelryk
4960ca0738 Merge branch 'w31_MDL-39915_m26_tests' of https://github.com/skodak/moodle 2013-07-30 10:19:41 +12:00
Marina Glancy
1171ad564b MDL-40897 avoid extra DB queries in groups_get_activity_groupmode() 2013-07-28 18:47:57 +10:00
Petr Škoda
87288183a4 MDL-39915 cleanup core_grouplib_testcase 2013-07-27 18:48:18 +02:00
Ankit Agarwal
e481f05c0d MDL-40354 groups: Fix issues in groups_group_visible() 2013-07-10 10:50:22 +08:00
Ankit Agarwal
f4d46f6848 MDL-40354 groups: Add unit tests for the api groups_group_visible() 2013-07-10 10:50:21 +08:00
Sam Hemelryk
e17dbeeb1a MDL-34398 groups: implemented caching of group information. 2013-01-17 09:24:58 +13:00
Andrew Robert Nicols
74b714df7e MDL-32005 Add idnumber field to groups and groupings 2012-05-15 09:38:51 +01:00