Applied the following changes to various testcase classes:
- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.
Special mention to:
- When belonging to other components and being valid api:
- analytics related tests have been moved to tests/analytics subdir.
- backup & restore related tests have been moved to tests/backup subdir.
- events related tests have been moved to tests/event subdir.
- privacy related tests have been moved to tests/privacy.
- task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
needed now that they are namespaced):
- some xxxlib_test.php have been renamed lib_test.php
(when they where testing the corresponding lib.php).
- cache stores tests have been all renamed store_test, originally
each one had its own name (file_test, apcu_test, redis_test...)
- assign feedback tests have been all renamed feedback_test, originally
each one had its own name (file_test, editpdf_test...)
The new get_safe_orderby() and get_safe_orderby_multiple() methods
provide a centralised safe way for user submitted sorting values to be
incorporated into SQL ORDER BY. They do this by removing the need for
user submitted data to pass in any SQL and not allowing arbitrary
column values, instead using string keys which map to a predefined
list of allowed sortable columns.
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.
AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
This commit replace as much as possible of clean_param and PARAM_ usages related to user object.
Also few unit tests has been changed to match the new validation
This is intended as a revision counter for local modinfo caching. It should be a lot more reliable and faster than doing it in PHP. Please note you need to invalidate all course caches after using this.
This function used to be in the user selector, but it is useful in
other areas where we want to search for users as it handles a number
of search options (including extra fields, etc.) and returns SQL
which can be included in a joined query.
A unit test has been added to check the results of these searches.
The purpose of this method is to ensure that when we display lists of
users in different places, the default sort order is consistent.
Having this code centralised in one place them makes it possible to
improve things accross the board, and there is an example of that here.
There is logic so that if we are searching for particular string, then
users with an exact match are sorted first.