111 Commits

Author SHA1 Message Date
Andrew Nicols
7bb9f136d2
MDL-81520 core: Fix test finality 2024-12-11 12:30:21 +08: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
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
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Marina Glancy
4d765cd699 MDL-77164 privacy: typehint test content writer 2023-04-13 09:43:15 +01:00
Dmitrii Metelkin
a6cad23b1a MDL-73431 enrol: Introduce a sync interval 2022-05-30 15:58:22 +10:00
Paul Holden
d4bd398ad7 MDL-73295 webservice: only pass around sesskey for tokens as needed. 2021-12-29 09:54:23 +00:00
Eloy Lafuente (stronk7)
e4a2d9c1d4 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:02 +01:00
Eloy Lafuente (stronk7)
57e6fb7ad9 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:02 +01: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
Tim Hunt
1dcd0d3499 MDL-68233 renderers/block: remove illegal uses of $PAGE and $OUTPUT 2020-03-29 15:34:26 +01:00
Andrew Nicols
6a91cc80c9 MDL-63535 core_rss: Coding style fix 2018-10-23 11:15:04 +08:00
Mihail Geshoski
cee33e0229 MDL-63535 core_rss: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-23 10:46:25 +08:00
Mark Nelson
97fcf562ba MDL-62224 core_rss: implement correct provider 2018-04-26 20:16:22 +08:00
sarjona
b720d9dae8 MDL-62078 rss: Link to core_userkey in the Privacy API implementation 2018-04-22 09:02:48 +02:00
David Monllao
8d3238d858 Merge branch 'MDL-61958-master' of git://github.com/sarjona/moodle 2018-04-18 18:23:48 +02:00
Michael Aherne
655727381d MDL-57777 rss: Return 404 when context not found. 2017-01-31 09:29:08 +00:00
Marina Glancy
6e0ecbe913 MDL-53039 rss: allow guest access to front page forum 2016-02-09 15:51:09 +08:00
David Monllao
7a3451bc1a MDL-33564 rss: Fixing missing param type 2015-09-15 17:58:05 +08:00
Dan Poltawski
20dbcc33e8 MDL-33564 rss: on error return HTTP error status
Also remove an unecessary debugging notice.
2015-08-28 09:53:01 +01:00
Andrew Davis
1502bf7734 MDL-46463 core_rss: coding style cleanup in /rss 2014-07-23 10:22:53 +08:00
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
2013-09-21 13:11:56 +02:00
Marina Glancy
44ddd2a115 MDL-41219 course: Make properties of course_modinfo read-only
added phpdocs and unittests
2013-09-10 14:11:37 +10:00
Petr Škoda
b0d1d941c9 MDL-40220 use new core_component::get_component_directory() 2013-07-16 22:42:37 +02:00
Petr Škoda
56da374e1e MDL-40220 use new core_component::normalize_component() 2013-07-16 22:41:00 +02:00
Jason Fowler
e73cb1acb8 MDL-37818 - RSS - Prevent access to blocks while RSS context errors are displayed 2013-07-02 10:03:41 +08:00
Dan Poltawski
e5e5097081 NOBUG - reduce whitespace errors a little 2013-04-15 13:29:14 +01:00
Frederic Massart
4373103084 MDL-34460 Librairies: Replaced deprecated get_context_instance() 2012-07-26 13:23:28 +08:00
Petr Skoda
f20edd5208 MDL-32094 fix various E_STRICT compatibility problems 2012-03-18 18:37:24 +01:00
Jason Fowler
13d1c9ed55 MDL-30991 - RSS - Doc-block clean up 2012-02-15 15:19:59 +08:00
Aparup Banerjee
9809413bba Merge branch 'MDL-29527' of git://git.luns.net.uk/moodle 2011-10-24 15:37:14 +08:00
Dan Poltawski
636b4f9d2c MDL-29527 - RSS: Add a description to the reset keys page
Thanks to Alexander Bias for the suggestion
2011-10-19 13:48:25 +01:00
Petr Skoda
e922fe23b6 MDL-29602 accesslib improvements
Refactoring and improvements of the accesslib.php library including prevention of access for not-logged-in users when forcelogin enabled, improved context caching, OOP refactoring of contexts, fixed context loading, deduplication of role definitions in user sessions, installation improvements, decoupling of enrolment checking from capability loading, added detection of deleted and non-existent users in has_capability(), new function accesslib test, auth and enrol upgrade notes.

More details are available in tracker subtasks.
2011-10-16 14:05:18 +02:00
Andrew Davis
c05ccf3fa7 rss MDL-25319 removing unnecessary call to isguestuser() 2010-11-19 06:39:00 +00:00
Andrew Davis
c61daed045 rss MDL-24509 added support for 1.9 rss feed requests 2010-10-05 03:30:01 +00:00
Andrew Davis
52cede73ab rss MDL-24509 added call to require_login() 2010-10-04 14:42:23 +00:00
Andrew Davis
83b912e0ed rss MDLSITE-1007 now running clean_param() over the user token 2010-10-04 06:56:51 +00:00
Martin Dougiamas
b111858d26 MDL-23391 Tidied up this script to make it more coding-style friendly 2010-07-20 09:06:35 +00:00
Andrew Davis
d4d1b048a5 rss MDL-23391 removed an outdated comment 2010-07-20 08:13:02 +00:00
Andrew Davis
274f98409a rss MDL-23391 refactored rss feeds to make them standard across components 2010-07-20 07:49:34 +00:00
Andrew Davis
690aa229c5 rss MDL-23391 committing refactored rss retrieval file 2010-07-20 03:47:20 +00:00
Andrew Davis
aa60291e12 rss MDL-23391 alter the rss urls to be component names ie mod_forum instead of just module name ie forum 2010-07-19 10:57:52 +00:00
jerome mouneyrac
e417be4ca2 rss MDL-22891 add hub rss support 2010-07-19 06:59:02 +00:00
Petr Skoda
df997f841f MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
    MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
    MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
    MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
    MOV [enrolenddate,core],[enrolenddate,enrol_self]
    CPY [welcometocourse,core],[welcometocourse,enrol_self]
    CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
    MOV [notenrollable,core],[notenrollable,core_enrol]
    MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
    MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
    MOV [coursemanager,core_admin],[coursecontact,core_admin]
    MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
    MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
    MOV [enrolme,core],[enrolme,core_enrol]
    MOV [unenrol,core],[unenrol,core_enrol]
    MOV [unenrolme,core],[unenrolme,core_enrol]
    MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
    MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
    MOV [enrolments,core],[enrolments,core_enrol]
    MOV [enrolperiod,core],[enrolperiod,core_enrol]
    MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
Andrew Davis
842cd18bc9 rss MDL-22204 added ability for user to reset their rss token 2010-05-13 02:07:57 +00:00
Petr Skoda
30d2453880 MDL-22204 fixed incorrect defines in rss file 2010-05-02 16:48:41 +00:00
Andrew Davis
fcce139aa3 RSS MDL-22204 committing new RSS code. Uses a token to ID the user. RSS feeds also generated/updated as needed rather than by cron.php 2010-05-02 11:43:57 +00:00
Petr Skoda
4f0c2d0009 MDL-21655 big scary enrolment and roles improvements - see tacker for list of changes, includes other minor fixes too 2010-03-31 07:41:31 +00:00
Petr Skoda
6f5e085205 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 16:48:45 +00:00
Petr Skoda
2e9b772fb8 MDL-20693 new NO_DEBUG_DISPLAY define 2009-10-31 22:02:05 +00:00