387 Commits

Author SHA1 Message Date
Andrew Nicols
cdbc789fd8
MDL-83412 calendartype_gregorian: Use core_date
Update timestamp_to_date_string to use core_date.
2024-11-28 11:55:15 +08:00
Andrew Nicols
c370c0cc5e
MDL-81521 core: Update all possibly data providers to be static
Note: Some data providers could not be automatically be converted to
being static. These will be handled in a separate issue.
2024-11-15 12:50:44 +08:00
Jun Pataleta
cb8208ca77
Merge branch 'MDL-82505-main' of https://github.com/HuongNV13/moodle 2024-07-18 12:51:06 +08:00
Huong Nguyen
c124b23784
MDL-82505 calendar: more precise matching of calendar day partial
The partial name selector points to the parent element,
but the Javascript code monitors the child element.
We need to make it consistent
2024-07-18 11:38:13 +07:00
Huong Nguyen
04f8f11d35
MDL-81272 calendar: Improve permission check for separate group mode 2024-07-15 09:29:08 +07:00
Sara Arjona
9e1eec783c
Merge branch 'MDL-82207' of https://github.com/stronk7/moodle 2024-06-26 12:27:19 +02:00
Meirza
d63aff3f51 MDL-81250 calendar: Use full course name as the course filter
Co-authored-by: Eduardo Domínguez <eduardo.dominguez@uib.es>
2024-06-25 16:35:38 +07:00
Eloy Lafuente (stronk7)
ad5fe71868
MDL-82207 phpunit: fix various @covers annotations (take#1)
This fixes various (not all) wrong @covers annotations that
are reported as warnings by PHPUnit when it's run with
code-coverage enabled.

When possible, the preferred solution is to change to
@covers at class level, that is the recommended way.

If multiple classes are involved, then a mix of @coversDefaultClass
and @covers at method level are used (always trying to use the
minimum needed patch).

This is the first of a series of issues created as sub-tasks
of MDL-82142.
2024-06-24 12:07:39 +02:00
Huong Nguyen
ebae7fbae4
Merge branch 'MDL-81523' of https://github.com/stronk7/moodle 2024-06-19 09:52:10 +07:00
Andrew Nicols
36772d4c8e
Merge branch 'MDL-81644-main-new' of https://github.com/meirzamoodle/moodle 2024-06-18 23:13:55 +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)
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
Meirza
b19b9cb8bf MDL-81644 calendar: The behaviour of event dates in the block calendar
There is a difference in the behaviour of the calendar block when it is on the calendar page and when it is not.
On the calendar page, when the user clicks on the date or link next/previous month or day name in the calendar block,
it will have the effect of changing the URL, which should not happen.

The patch also includes hiding popover after the user clicks the day number. When the user clicks on the date or
is focused on the date and then presses enter on the keyboard, the popover does not automatically close.
To fix this, I added an event type, "click", to be attached to the hidePopover function and added conditioning to
the target element when there was a "click" event.

An additional step was added to the Behat calendar for the click event to ease the testing process.

For the popover, I set the "animation" to false to avoid the random Behat failure caused by the slow animation.
2024-06-07 14:46:44 +07:00
Huong Nguyen
6bfdae885d
MDL-81530 editor_tiny: Better browsers compatibility
The TinyMCE.remove() function is killing other events on Firefox
We need to modify the setupForElementId() to make TinyMCE to
remove itself outside of the event loop
2024-05-07 14:23:03 +07:00
Jun Pataleta
9573a6f9c1
Merge branch 'MDL-79007_main' of https://github.com/marxjohnson/moodle 2024-03-20 10:45:14 +08:00
Mark Johnson
f419983b32
MDL-79007 calendar: Make screen readers read out calendar day popovers 2024-03-18 11:25:46 +00:00
Andrew Nicols
9cdc5850c5
Merge branch 'MDL-75952' of https://github.com/stronk7/moodle 2024-03-12 10:45:02 +08:00
Paul Holden
400227c0f4
MDL-73117 calendar: restore previously removed Behat step definition. 2024-03-11 12:09:27 +00:00
Paul Holden
ccc4647043
Merge branch 'MDL-73117' of https://github.com/Chocolate-lightning/moodle into main 2024-03-11 12:01:49 +00:00
Mathew May
3d301abcec MDL-73117 calendar: Final deprecation of threemonth_cal 2024-03-11 09:05:10 +08:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Juan Leyva
d271925d56 MDL-81089 calendar: Return if module is branded 2024-03-07 17:32:37 +01:00
Ilya Tregubov
dcc9324b68 Merge branch 'MDL-78850-main' of https://github.com/meirzamoodle/moodle 2024-03-05 11:23:17 +08:00
Meirza
edce8cca8b MDL-78850 calendar: course calendar improvement 2024-02-29 12:48:56 +07: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
Neill Magill
6ff5e7aabd MDL-77965 unit tests: Add covers annotation 2024-02-23 09:32:07 +00:00
Paul Holden
b98fd96084
MDL-71733 behat: final removal of deprecated 400 step definitions. 2024-01-04 12:43:52 +00:00
Huong Nguyen
a529ee94b3 MDL-80151 behat: Improve viewing site calendar step 2023-12-20 16:31:00 +08:00
Simey Lameze
2321dc3396 MDL-80151 behat: add calendar step to navigate to specific view 2023-12-18 16:10:11 +08:00
Sara Arjona
cc9430929d
MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:30:19 +02:00
Angelia Dela Cruz
09d654b3fe MDL-78158 behat: Behat cleanup and optimisation 2023-07-04 07:01:27 +08:00
Angelia Dela Cruz
9f101a30b2 MDL-78158 Behat: Use data generators to add blocks 2023-07-03 17:41:21 +08:00
Meirza
00bea84ed6 MDL-77350 calendar: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-16 00:33:20 +07:00
Ilya Tregubov
1c25a0cc2f Merge branch 'MDL-77577-master' of https://github.com/andelacruz/moodle 2023-04-20 12:33:23 +08:00
Marina Glancy
4d765cd699 MDL-77164 privacy: typehint test content writer 2023-04-13 09:43:15 +01:00
Andrew Nicols
faa68960ad MDL-76866 calendar: Make test more specific 2023-03-29 20:33:47 +08:00
Stephan Robotta
06872a4ebd MDL-77392 calendar: calendar items are hidden because of settings 2023-03-23 12:39:15 +01:00
Angelia Dela Cruz
374b6d8e0e MDL-77577 Behat: Replaced the use of "Install selected language pack(s)
Evaluated usage of "Install selected language pack(s)" in Behat and
replaced the steps to use generator to install language packs as part
of test setup.
2023-03-21 11:58:30 +08:00
Mathew May
e5ca7766e7 MDL-52805 core: Remove legacy log calls 2023-03-07 13:08:46 +08:00
Jun Pataleta
317af68140 Merge branch 'MDL-76537' of https://github.com/stronk7/moodle 2023-01-19 11:24:04 +08:00
Jun Pataleta
fad05d7929 Merge branch 'MDL-76583-master-withoutrename' of https://github.com/andrewnicols/moodle 2023-01-19 09:44:48 +08:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Paul Holden
af8da7c737 MDL-70070 phpunit: correct data provider method names.
They should not be prefixed `test_` because that's how actual
test methods containing assertions are identified by PHPUnit.
2023-01-16 08:28:37 +00:00
Eloy Lafuente (stronk7)
357f784091 MDL-76537 behat: Month and day names are lang-dependent correct utf-8
Just verify that calendars are always displayed with correct UTF-8
and in the language the user is currently using.
2023-01-13 09:57:28 +01:00
Philipp Memmel
b84005ef9f MDL-76061 core_calendar: Fix changing event type from 'user' 2023-01-09 14:49:50 +01:00
Simey Lameze
1531541451 MDL-76507 behat: change step to use 'Recent and next 60 days' option
It was detected that 'This month' option may cause failures in builds in between months
so using the 'Recent and next 60 days' still fixes the weekend scenario and also the
in between months issue.
2022-12-01 08:50:58 +01:00
Simey Lameze
4be0e3541e MDL-76507 behat: use 'This month' option when exporting
This is necessary because 'This week' option is conditionally
hidden on weekends making behat builds to fail on those days.

Also, the last two steps had to be split because Bennu library
adds days with leading zero and moodle removes it by default.
2022-11-30 19:57:35 +08:00
Marina Glancy
7bbb5434bf MDL-75100 core: replace function strftime deprecated in PHP 8.1 2022-11-21 11:41:12 +01:00