11 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
9f53b0e965 MDL-73971 phpunit: Move more tests to use correct names and namespaces
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:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
2022-05-06 18:29:11 +02: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
Jenkins Automation
5650b7e3ad MDL-69726 calendar: fix raw event fetcher under postgres
Without this, there's a code path that under the right circumstances is hit and
results in a query with `FROM (mdl_event) ev` in it - which is not valid syntax
under postgres.
2020-10-13 09:33:52 +10:30
Shamim Rezaie
7385ee37f9 MDL-58768 Calendar: Update get_raw_events_legacy_implementation
Update get_raw_events_legacy_implementation to work with the passed $users parameter instead of the logged in user.
Also, fixed a bug where get_raw_events_legacy_implementation was failing when $users was set to true, and a list of
$groups was given.
2018-07-28 07:51:32 +10:00
Michael Hawkins
ef4e04ee26 MDL-37624 calendar: Added location support 2018-06-29 10:46:54 +08:00
Andrew Nicols
0085b0ea3c MDL-59890 calendar: Add support for the category to vault 2017-10-03 21:28:31 +08:00
Cameron Ball
a776415d55
MDL-58578 core_calendar: Properly respect priorities on overview
Prior to this patch, if a user was in two groups, and an override
existed for both groups in an assignment the override
visually lower on the override list would be displayed on the
overview, whereas the one visually higher would be displayed
in the assignment grading table.
2017-04-27 15:15:12 +08:00
Mark Nelson
e1cd93ce20 MDL-58423 core_calendar: moved \core_calendar\event class
Part of MDL-55611 epic.
2017-04-04 11:01:49 +01:00
Jun Pataleta
20592f5ff2 MDL-58386 calendar: Fixed CI issues
Part of MDL-55611 epic.
2017-04-04 11:01:47 +01:00
Cameron Ball
bd01fd15d4 MDL-58087 core_calendar: Unit tests now jam with new vault behaviour
Some unit tests needed to be updated to specify a few extra
bits and pieces on the events to work properly with the
new event vault behaviour.

Part of MDL-55611 epic.
2017-04-04 11:01:41 +01:00
Cameron Ball
258a570563 MDL-58087 core_calendar: Move logic from get_events to the local API
The logic from get_events has now been moved in to our local API
and is used by the event vault to retrieve events, instead of
querying the database directly.

This has the advantage that it deals with overrides and only
returns events for the relevant user.

Part of MDL-55611 epic.
2017-04-04 11:01:40 +01:00