493 Commits

Author SHA1 Message Date
Marina Glancy
18067c8971 MDL-83504 user: reset preference cache in unittests 2024-10-21 17:58:50 +01:00
Ilya Tregubov
1d48c46edb Merge branch 'MDL-82663' of https://github.com/paulholden/moodle 2024-09-20 10:17:02 +08:00
Ilya Tregubov
adaa1944af Merge branch 'MDL-82494' of https://github.com/paulholden/moodle 2024-09-19 14:04:48 +08:00
Trisha Milan
e52fbd2f84 MDL-66151 Performance: Session Manager modularisation
Storage of session metadata has moved into the session handler class.
This allows for other classes to fully control session handling and
removes the dependancy on the core sessions database table.

Previously, the standard method of interaction with the
session metadata was direct DB calls; this may break other plugins as there
are now proper APIs available through the session manager.

Co-authored-by: Darren Cocco <moodle@darren.cocco.id.au>
Co-authored-by: Trisha Milan <trishamilan@catalyst-au.net>
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2024-09-03 13:04:04 +10:00
Paul Holden
1965c0caf0
MDL-82494 user: correct profile field name formatting method.
Add optional `$escape` parameter to allow for unescaped return.
2024-08-30 09:47:13 +01:00
Paul Holden
50c64005e8
MDL-82663 user: fix check for current user removing own enrolment.
We only need to remove the current user from selection if they were
ever part of the selection originally.
2024-08-27 16:55:13 +01:00
ferranrecio
a2ed8a036d MDL-81889 tool_generator: add examples to behat steps
The tool_generator creates a testing scenario that can execute
all steps from behat_data_generators (with some limitations),
change admin settings and delete courses and users to cleanup
the created entities. However, this list of valid steps will
change over time and it will be great if all available steps
are listed with examples.
2024-08-12 12:25:46 +02:00
Andrew Nicols
614b3bf9b3
MDL-81031 core: Add some new WS 2024-08-06 16:01:07 +08:00
Andrew Nicols
1b7d08465c
MDL-81031 core: Add routing 2024-08-06 16:01:07 +08:00
Shamim Rezaie
5aee595206 Merge branch 'MDL-78030-main-improvement' of https://github.com/meirzamoodle/moodle 2024-07-31 17:38:29 +10:00
meirzamoodle
699daafc64 MDL-64148 core: Make email greetings consistent
Some email body strings use first names as greetings,
some use full names, and some do not.

Using the first name for greeting makes it consistent and
a bit more "personal".
2024-07-30 22:40:47 +07:00
meirzamoodle
9354b80a52 MDL-78030 user: Implementing the count window function 2024-07-29 13:58:38 +07:00
Huong Nguyen
854296c210
Merge branch 'MDL-81888-main-v02' of https://github.com/ferranrecio/moodle 2024-07-25 08:58:19 +07:00
Jun Pataleta
cf2073134a
Merge branch 'MDL-82066' of https://github.com/paulholden/moodle 2024-07-18 00:03:02 +08:00
Ilya Tregubov
7f63a6af7a Merge branch 'MDL-78293-master' of https://github.com/jleyva/moodle 2024-07-16 11:47:22 +08:00
ferranrecio
5617445d42 MDL-81888 tool_generator: add cleanup scenario tag
The tool_generator creates a testing scenario that can
execute all steps from behat_data_generators (with some
limitations) and admin settings. With the patch the scenario file can
incorporate a cleanup steps to be executed when the manual test is done.
2024-07-12 10:32:54 +02:00
Juan Leyva
2a2130e9d7 MDL-78293 core_user: New Web Services to manage private files 2024-07-11 11:54:35 +02:00
Huong Nguyen
2845d8cbde
Merge branch 'MDL-79717' of https://github.com/paulholden/moodle 2024-07-11 09:34:52 +07:00
Paul Holden
9d621f5da1
MDL-82066 user: define methods for handling default homepage URLs.
Per the previous commit, default homepage configuration (set either
for the site or as a user preference) can now be extended by third
party hook callbacks, in which case a URL is stored.
2024-07-10 17:12:31 +01:00
Paul Holden
bd0f8a058f
MDL-79717 phpunit: ensure unique data provider keys in tests.
Duplicate data provider keys were overwriting and/or duplicating
one another, leading to some cases being skipped.

Other "duplicate array key" errors were picked up by `phpcs` in
this dragnet across all tests, which have also been fixed.
2024-07-10 14:08:49 +01:00
David Woloszyn
2e0579ce3a MDL-58353 report_usersessions: Ability to logout all other sessions 2024-07-09 13:39:27 +10:00
Huong Nguyen
ccd8089de9
Merge branch 'MDL-80907' of https://github.com/marinaglancy/moodle 2024-07-04 11:12:50 +07:00
Sara Arjona
36f5b40830
Merge branch 'MDL-81857' of https://github.com/paulholden/moodle 2024-06-19 15:52:57 +02:00
Eloy Lafuente (stronk7)
674497a12c
MDL-81523 phpunit: Add all missing setUp/tearDown parent calls
All setUp(), tearDown(), setUpBeforeClass() and tearDownAfterClass()
must, always, call to parent, to ensure that everything is properly
set and cleaned.

While in a lot of situations this is not needed (parents may not
have anything to run), with PHPUnit >= 10 this can become more
important because we are going to move the reset code from current
placement @ runBare() to setUp()/tearDown().

Note that all the changes performed in this commit have been detected
and fixed by moodle-cs (ParentSetUpTearDownSniffTest).
2024-06-14 16:04:57 +02:00
Sara Arjona
b1b3f409fc
Merge branch 'MDL-81942' of https://github.com/paulholden/moodle 2024-06-12 15:47:54 +02:00
Paul Holden
f4d4f1ca6a
MDL-81942 user: guests should respect default site homepage setting. 2024-06-12 11:34:59 +01:00
Eloy Lafuente (stronk7)
4f7631113c
MDL-81522 phpunit: Add missing void return type to all tests #2
This commit includes more changes, all them also adding the :void
return type to unit tests missing them.

The difference is that all these changes, while also detected
perfectly by the moodle.PHPUnit.TestReturnType sniff, were not
auto-fixed (like the previous commit ones), because all them
do include some "return" statement and, for safety, we don't
fix them.

All the cases have been visually inspected and confirmed that
the existing "return" statements always belong to anon
functions within the test body and not the test own return statement.
2024-06-11 11:55:08 +02:00
Eloy Lafuente (stronk7)
01148a0816
MDL-81522 phpunit: Add missing void return type to all tests
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
2024-06-11 11:55:07 +02:00
Paul Holden
89376f78af
MDL-81857 user: don't check whether address is an identity field.
It can never be selected as one, so the previous comparison could
never pass.
2024-06-06 08:58:36 +01:00
Marina Glancy
49ab83c1a4 MDL-80907 various: fixes to incorrect column selectors in behat 2024-05-07 19:27:14 +01:00
Paul Holden
e95cf00523
MDL-81399 reportbuilder: add language/timezone reporting for users. 2024-04-29 11:12:01 +01:00
Andrew Nicols
64aedb9b24
MDL-77967 core_user: Coding style fixes in tests 2024-04-11 14:00:46 +08:00
Andrew Nicols
b64dff686e
Merge branch 'MDL-77967-main' of https://github.com/rmady/moodle 2024-04-11 13:56:54 +08:00
Daniel Ziegenberg
08027e408c
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."

So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:45 +01:00
Daniel Ziegenberg
87267da39d
MDL-81281 phpunit: assertObjectNotHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectNotHasProperty() instead."

So we replace all instances of assertObjectNotHasAttribute with
assertObjectNotHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:07 +01:00
Jun Pataleta
f150d5016d
Merge branch 'MDL-81132-master' of https://github.com/jleyva/moodle 2024-03-22 11:57:23 +08:00
Jun Pataleta
e366db6c55
Merge branch 'MDL-80843' of https://github.com/paulholden/moodle 2024-03-22 11:34:23 +08:00
Juan Leyva
ca8f197148 MDL-81132 mod_forum: Perforance improvements for app 2024-03-08 10:08:19 +01:00
Marina Glancy
d395925a40 MDL-80548 admin: Add bulk user actions also to user list 2024-03-04 12:14:45 +00:00
Paul Holden
d3557d9483
MDL-80843 reportbuilder: consistent user auth report entity data.
Tidy up unit tests for user report, removing some redundancy and
duplication.
2024-02-23 09:28:44 +00:00
Rodrigo Mady
b2af915288 MDL-77967 user: Add format text to custom profile fields name 2024-02-16 16:58:49 -03:00
Paul Holden
ebcc967d2e
MDL-80258 reportbuilder: ensure consistent reporting of entity themes.
Courses, categories, users & cohorts each have a configurable `theme`
attribute - ensure reporting on said value is consistent across all the
corresponding entities.
2024-02-14 12:12:37 +00:00
Sara Arjona
ce7f3eef04
Merge branch 'MDL-79552' of https://github.com/paulholden/moodle 2024-02-14 09:30:09 +01:00
Sara Arjona
6cea979891
Merge branch 'MDL-79681' of https://github.com/paulholden/moodle 2024-01-24 17:02:17 +01:00
Paul Holden
a32397feda
MDL-80328 user: use modal confirmation for admin deleting users. 2024-01-10 09:06:07 +00:00
Paul Holden
7f6179fc9d
MDL-79681 user: fix participant filter "never accessed" options.
For courses, determine whether "Never accessed" should be available,
and correct the used value to match that expected by the API (-1).
2024-01-05 13:55:47 +00:00
Paul Holden
4fb106506d
MDL-79552 cohort: add cohort data to user-focused custom reports. 2023-12-15 09:58:19 +00:00
David Carrillo
f76a518cb1
MDL-79270 user: New 'Browse list of users' system report
- The report 'Browse list of users' has been converted to use Report
Builder.
- Behat tests have been fixed and some test have been deleted for not
being relevant anymore.
2023-12-11 12:36:54 +01:00
David Carrillo
b0c89b310e
MDL-79270 reportbuilder: Add lastip column/filter to user RB entity 2023-12-11 12:35:58 +01:00
Ilya Tregubov
4355e38e88
Merge branch 'MDL-78312-master' of https://github.com/NashTechOpenUniversity/moodle 2023-09-15 16:56:22 +08:00