383 Commits

Author SHA1 Message Date
Andrew Nicols
55126be4ad
MDL-81520 core: Fix test finality 2024-12-11 12:30:21 +08:00
Andrew Nicols
68c96a97b9
MDL-83412 calendartype_gregorian: Use core_date
Update timestamp_to_date_string to use core_date.
2024-11-28 11:55:25 +08:00
Andrew Nicols
c6942c9bb7
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-18 10:24:55 +08:00
Jun Pataleta
d0ce8e8d62
Merge branch 'MDL-82505-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-18 12:50:57 +08:00
Huong Nguyen
266c8b73b0
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:37:07 +07:00
Huong Nguyen
978ada1047
MDL-81272 calendar: Improve permission check for separate group mode 2024-07-15 15:46:55 +07:00
Andrew Nicols
1d753e37af
Merge branch 'MDL-81644-404-new' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2024-06-18 23:25:33 +08:00
Eloy Lafuente (stronk7)
091b458c52
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 12:18:05 +02:00
Eloy Lafuente (stronk7)
1093256560
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 12:18:04 +02:00
Meirza
821f2a390c 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:45:24 +07:00
Huong Nguyen
7ac2d7f598
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:21:22 +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
Marina Glancy
55b9fa4b32 MDL-76333 calendar: add test for calendar export 2022-11-16 16:51:19 +01:00
Simey Lameze
a512ba0b3c MDL-75282 behat: Use more precise step definitions
Note: This should possibly be broken out into its own issue and applied
to stables.

Part of MDL-75966.
2022-11-10 19:54:31 +08:00
Marina Glancy
41b93bd7e5 MDL-73424 general: Internal methods must have same type as parent
Otherwise the error is thrown in PHP8.1
2022-10-10 16:46:13 +02:00
Sara Arjona
fdc4576f9f Merge branch 'MDL-74866-master' of https://github.com/HuongNV13/moodle 2022-09-07 13:10:05 +02:00