Commit graph

307 commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
6ca32e21e5 Merge branch 'MDL-70148-master' of git://github.com/andrewnicols/moodle into master 2020-11-17 23:12:56 +01:00
Andrew Nicols
ba34d6e225 MDL-70148 behat: Update steps for keyboard 2020-11-17 15:14:43 +08:00
Paul Holden
5fb73c9639 MDL-69964 course: toggle participant checkboxes in root element.
For a given toggleGroup, the relevant action elements are not
necessarily descendants of the same tableRoot element, on the
course participants page.
2020-11-16 17:44:17 +00:00
Shamim Rezaie
ce484f2872 MDL-68167 user: Improve keyboard navigation on autocomplete fields 2020-10-30 14:43:00 +11: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
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f94195c320 MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Paul Holden
2175216110 MDL-66648 user: consistent checks for linking to full profile.
The access checks for displaying a link to a users' full profile
now match the checks performed on the full profile page itself.
2020-09-14 20:22:07 +01:00
Luca Bösch
4994817908 MDL-68334 user: Display name in footer as elsewhere. 2020-08-08 10:38:56 +02:00
Michael Hawkins
c2f188311e MDL-69336 lib: Reinstating tablelib column show/hide functionality
Also added behat testing for hide/show columns in participants table.
2020-08-04 15:18:39 +08:00
Andrew Nicols
8d5926bead MDL-69026 user: Correct statuses => status in test 2020-06-12 10:03:06 +08:00
Andrew Nicols
8bcf74e9bc MDL-69026 user: Wrap sub-query in brackets
It is perfectly valid to have a query like:

Match None of the following:
- Role is ANY of the following:
-- 'Teacher'
-- 'Editing teacher'
-- 'Manager'; AND
- Keyword is NONE of the following:
-- 'Kevin'

However, due to the way in which the query is constructed, this leads to
a query which includes

    WHERE NOT ef.id IS NOT NULL
    AND NOT
        u.id IN (SELECT userid FROM {role_assignments} WHERE roleid IN (...) AND contextid IN (...))
    AND NOT
        NOT (u.firstname || ' ' || u.lastname LIKE '%Kevin%')

The use of NOT NOT is valid in Postgres, MariaDB, MySQL, and MSSQL, but
not in Oracle.

To counter this when the outer jointype is of type NONE, we must wrap
each of the inner WHERE clauses in a set of brackets, which makes the
query:

    WHERE NOT ef.id IS NOT NULL
    AND NOT
        (u.id IN (SELECT userid FROM {role_assignments} WHERE roleid IN (...) AND contextid IN (...)))
    AND NOT
        (NOT (u.firstname || ' ' || u.lastname LIKE '%Kevin%'))

Whilst Oracle does not support the use of `AND NOT NOT ...`, it does support
`AND NOT (NOT ...)`
2020-06-12 10:03:06 +08:00
Jun Pataleta
02b7fac93d Merge branch 'MDL-69017-master' of git://github.com/andrewnicols/moodle 2020-06-11 16:59:04 +08:00
Andrew Nicols
d3bfae8fcc MDL-69017 user: Show all links should work for students 2020-06-11 15:51:41 +08:00
Jun Pataleta
49a34f1593 Merge branch 'MDL-68912' of https://github.com/rlorenzo/moodle 2020-06-11 11:01:05 +08:00
Rex Lorenzo
330c871c3f MDL-68912 user: "Send a message" select all not working 2020-06-10 17:53:53 -07:00
Victor Deniz Falcon
034ba327d0 Merge branch 'MDL-68980-master' of git://github.com/andrewnicols/moodle 2020-06-10 21:41:56 +01:00
Jun Pataleta
15823a94c1 Merge branch 'MDL-68989-master' of git://github.com/mickhawkins/moodle 2020-06-11 00:03:54 +08:00
Andrew Nicols
9a7bd66b4e MDL-68980 user: Add additional groupmode participants tests 2020-06-10 16:23:58 +08:00
Marina Glancy
09fe2a0ce2 MDL-68980 user: Test for groupmode participants behaviour 2020-06-10 14:15:41 +08:00
Michael Hawkins
f2972e1dcb MDL-68989 user: Apply none filterset join correctly on keyword filter
Also improved behat coverage for filterset joins and keyword filtering.
2020-06-09 15:49:31 +08:00
Michael Hawkins
8ddfc963b9 MDL-68984 user: Ensure first/last name filtering is always applied
This ensures the firstname and surname filtering is applied in addition
to any other filtering, rather than using the filterset join type.
2020-06-09 12:36:11 +08:00
Sara Arjona
515bc8f4e0 MDL-68745 user: remove empty line 2020-06-05 21:57:24 +02:00
Sara Arjona
6ddab9d6d3 Merge branch 'MDL-68745-master-2' of git://github.com/mickhawkins/moodle 2020-06-05 21:30:07 +02:00
Michael Hawkins
f32f25b89d MDL-68745 lib: Updated table filters to support non-English characters
Added support for non-English first/last name filtering.
2020-06-04 12:48:03 +08:00
Michael Hawkins
5187e7c515 MDL-68612 core: Behat tests updated to support new participants filter
Existing tests have been updated, rewritten and/or expanded to support
the new participants filter.
2020-06-03 14:29:22 +08:00
Michael Hawkins
2396e3156f MDL-68612 user: Unified filter deprecations - related library functions 2020-05-29 12:13:26 +08:00
Michael Hawkins
d85315ee8c MDL-68612 user: Update participants group filtering to enforce groups
This is required to ensure regardless of user applied filters, only
members of groups visible to the user are ever fetched. This also
includes a fix to remove the groups filter option where no groups
mode is applied.
2020-05-29 10:10:33 +08:00
Michael Hawkins
d26b3ad524 MDL-68348 user: Added filterset joins unit testing 2020-05-25 18:35:08 +08:00
Michael Hawkins
4fa636330f MDL-68348 user: Added other logical operators to filter unit tests 2020-05-25 18:35:08 +08:00
Michael Hawkins
6a54e58a8c MDL-68348 user: User filter match types support - enrol method & status
Completed support for all join types (any/all/none) for enrolment
method and status filtering. This includes handling forced status
filtering where a user does not have the capability to view suspended
users, as well as handling front page (whole site) participants page.
2020-05-25 18:35:08 +08: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
25d9dabdcf MDL-68348 user: User filter match types support - keywords/last access
The last access implementation also fixes an existing bug,
where it was assumed never accessed would be 0, when it also needed to
handle null to return correct results. Related userlib unit tests also
updated to reflect this, as well as some incorrect comment wording.
2020-05-25 18:35:08 +08:00
Andrew Nicols
e1657e3c07 Merge branch 'MDL-68661-rebase' of https://github.com/Chocolate-lightning/moodle 2020-05-22 11:12:46 +08:00
Mathew May
7f86455237 MDL-68661 core_lang: Roll back addresourceoractivity 2020-05-22 10:02:57 +08:00
Marina Glancy
5b529aca15 MDL-68333 testing: trigger user_created event in user generator 2020-05-19 19:11:54 +02:00
Andrew Nicols
ed23725bc6 MDL-68463 user: Update select/show [count] links dynamically 2020-05-18 20:03:38 +08:00
Andrew Nicols
d525ac4b8d MDL-68246 user: Add participants_search role & keyword unit tests
Created the participants_search unit testing file, including
tests for role, keywords, status and enroment method filtering.

Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2020-05-14 15:47:34 +08:00
Andrew Nicols
7afd16ad84 MDL-66109 behat: Require newline at EOF
This change enables the gherkinlint rule to require a new line at the
end of the file. This change is in keeping with existing Moodle coding
style guidelines.
2020-05-11 11:07:49 +08:00
Andrew Nicols
149d80e819 MDL-66109 behat: Fix Example usage in feature files
The gherkin-lint package now understands the use of "Examples" and
requries that their indentation be correct and consistent.

This change sets the indentatation for these to:

    "Examples": 4,
    "example": 6,

This is in-line with the examples given in the offical Cucumber/Gherkin
documentation at
https://cucumber.io/docs/gherkin/reference/#scenario-outline whereby the
Examples and individual rows of the Examples table are children of the
Scenario outline.

This is contrary to the default for Gherkin-lint which places them as
top-level nodes with an indentatio of 0, and 2 respectively.
2020-05-11 10:55:58 +08:00
Simey Lameze
937f21d3b8 MDL-68462 core_table: add @javascript to failing scenario 2020-05-06 09:44:44 +08:00
David Mudrák
8599eb5ebb MDL-68434 lang: Use the updated terminology in the tests 2020-04-29 17:40:58 +02:00
Eloy Lafuente (stronk7)
a0ea162f63 Merge branch 'MDL-67672-master' of git://github.com/lucaboesch/moodle 2020-04-02 00:16:51 +02:00
Luca Bösch
2ad02280a9 MDL-67672 user: Display name in user menu as elsewhere. 2020-04-02 00:04:38 +02:00
Jake Dallimore
f5609ea9d6 Merge branch 'MDL-67672-master' of git://github.com/lucaboesch/moodle 2020-04-01 16:43:03 +08:00
Luca Bösch
dfe22c29c2 MDL-67672 user: Display name in user menu as elsewhere. 2020-04-01 09:03:03 +02:00
Simey Lameze
88659cd703 MDL-68225 core_user: add behat coverage for group modes 2020-03-31 15:09:40 +08:00
Sara Arjona
4767b7bff1 Merge branch 'MDL-67863-master' of git://github.com/bmbrands/moodle 2020-03-04 14:05:17 +01:00
Andrew Zito
1e67849c1f MDL-63316 participants: lastname sort for participants table 2020-02-28 14:34:18 -05:00