3211 Commits

Author SHA1 Message Date
Jun Pataleta
a360fd0601 Merge branch 'MDL-76977-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-01-25 16:10:18 +08:00
Andrew Nicols
710d0ef8f2 MDL-75945 core: Convert a floating value to an integer.
In PHP 8.1, any implicit conversion of float to int, which leads to a loss in precision, is now deprecated.
To avoid the error warning, the code must explicitly convert a floating value to an integer.
2023-01-24 16:53:34 +07:00
Andrew Nicols
dbfb5eaa45 MDL-76362 core: Short-circuit strip_querystring on empty values 2023-01-23 09:16:08 +08:00
Andrew Nicols
a1f4f7bac5 MDL-76362 core: plugin names must be strings to be valid 2023-01-23 09:16:07 +08:00
Andrew Nicols
d08319ddf7 MDL-76362 core: Update core_component plugin name tests 2023-01-23 09:16:07 +08:00
Marina Glancy
2dd7290ccb MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:16:06 +08:00
Paul Holden
a68f5c6d37 MDL-76977 phpunit: ensure unique data provider keys in mustache test. 2023-01-20 17:21:27 +00:00
Paul Holden
70a5e38b2c 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:31 +00:00
Ilya Tregubov
f84d8e3c37 Merge branch 'MDL-76399-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-29 09:43:28 +07:00
Philipp Imhof
9d64ad1416
MDL-76731 behat: add steps to check for version
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2022-12-22 17:12:47 +01:00
Mark Johnson
0c448af668 MDL-75105 tool_behat: List available data generators
This will find all data generators that can be used in behat via the
'the following "something" exist:' step, and display them in a select
list on the step definitions page.

When a generator is selected, it will fetch the required fields for that
generator and display them on the page.
2022-12-21 08:38:28 +00:00
Paul Holden
1dda343f05 MDL-76399 behat: improvements to "should exist in" thrown exception. 2022-12-16 12:29:57 +00:00
Jun Pataleta
4426e21204 Merge branch 'MDL-76559-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2022-12-06 23:19:37 +08:00
Andrew Nicols
fb7d1b34ef MDL-76559 core: validate_email should not accept empty values 2022-12-06 20:53:47 +08:00
Ilya Tregubov
e572943d21 Merge branch 'MDL-76490-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-06 13:09:38 +03:00
Ilya Tregubov
bc5c812db3 Merge branch 'MDL-75516_401' of https://github.com/larsbonczek/moodle into MOODLE_401_STABLE 2022-12-06 10:38:12 +03:00
Marina Glancy
40ee69ea8b MDL-76490 behat: correct step for opening autocomplete in container. 2022-12-05 14:21:53 +00:00
Ilya Tregubov
a7e9836173 Merge branch 'MDL-76495-401' of https://github.com/marinaglancy/moodle into MOODLE_401_STABLE 2022-12-02 13:49:13 +03:00
Lars Bonczek
add1d29339 MDL-75516 core: Perform proper JSON encoding in mustache quote helper 2022-12-02 11:22:23 +01:00
Andrew Nicols
715ec40ad6 Merge branch 'MDL-76493-401' of https://github.com/marinaglancy/moodle into MOODLE_401_STABLE 2022-12-02 12:15:30 +08:00
Marina Glancy
a5f92c041e MDL-74853 various: add second parameter to htmlentities functions
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
2022-11-28 16:12:32 +01:00
Marina Glancy
6989097a3c MDL-76495 lib: test for qrcode in TCPDF 2022-11-28 16:02:03 +01:00
Marina Glancy
d311cab0c0 MDL-76493 core: make sure format_string(null) works on PHP 8.1 2022-11-28 11:55:50 +01:00
Marina Glancy
7bbb5434bf MDL-75100 core: replace function strftime deprecated in PHP 8.1 2022-11-21 11:41:12 +01:00
David Mudrák
5e2e7562b6 MDL-76105 lang: Use fixed strings in tests, too. 2022-11-17 10:37:45 +00:00
Andrew Nicols
7e6d32d7c2 Merge branch 'MDL-76112-master' of https://github.com/marinaglancy/moodle 2022-11-16 10:07:49 +08:00
Paul Holden
76c68e2146 Merge branch 'MDL-68550-master' of https://github.com/rezaies/moodle 2022-11-10 11:59:35 +00:00
Shamim Rezaie
8e31a72c05 MDL-68550 output: Improve accessibility of the initials bar
- The current item should be focusable otherwise the focus will be lost
  as soon as a user clicks on an item in the initials bar
- Modified behat tests to not mistakenly click on the 'All' link
- Use the nav tag because each item in the initials bar is a
  navigation link within the current document
- The currently selected item is specified by aria-current
- Useed aria-current=true rather than =page because the links of each
  item in the initials bar is missing the pagination information
2022-11-10 06:06:02 +11:00
Shamim Rezaie
e29007d679 MDL-68550 output: Improve accessibility of the paging bar
The use of aria-current is based on the example at
https://design-system.w3.org/components/pagination.html
2022-11-10 06:06:02 +11:00
Jun Pataleta
9555637d64 Merge branch 'MDL-76053' of https://github.com/stronk7/moodle 2022-11-09 21:28:30 +08:00
Sara Arjona
a74782dcc3 Merge branch 'MDL-75889' of https://github.com/paulholden/moodle 2022-11-09 12:36:39 +01:00
Eloy Lafuente (stronk7)
621d75dbce MDL-76053 admin: Remove various warnings related to MNet
This partially reverts MDL-73270, where some useful environmental
checks and notifications in the admin UI were added to inform
about different parts of Moodle relying on the "unsupported"
php-xmlrpc extension.

Since then, some changes have happened in core, only available
for Moodle 4.1 and up (see the MDL-70889 mini-epic). Namely:

  - MNet (SSO, roaming, auth, enrol and Mahara portfolio) are not
    using the php-xmlrpc extension anymore, but a pure php library.
  - The xmlrpc webservices protocol, has been move from core to
    the plugins directory, although it continues using the php-xmlrpc
    extension.

Because of that here we are removing all the checks and notifications
related with MNet (not using the extension anymore), but keeping the
webservice plugin ones (still using the extension). Surely if some day the
protocol stops using the extension, we'll be able to remove the
corresponding checks too. But that's future.

Note the associated lang strings have been also removed (not deprecated)
because they were highly specific and hardly reusable:
  - xmlrpcmaharaenabled
  - xmlrpcmnetauthenticationenabled
  - xmlrpcmnetenabled

And very same applies, because MNet doesn't contain anything deprecated
or not supported anymore, hence, straight deletion, to the function:
  - mnet_get_deprecation_notice()

Also, related tests using any of the removed stuff above have been deleted.

In the other side, the "check_xmlrpc_usage" continues existing and
being used both by environment checks and admin notifications but,
as commented above, now it only looks for the xmlrpc webservice
protocol now.
2022-11-08 16:49:18 +01:00
Paul Holden
c4c823c20e MDL-75889 core: compare domain names in a case-insensitive manner.
As per https://www.rfc-editor.org/rfc/rfc1035#section-3.1
2022-11-07 22:37:15 +00:00
Eloy Lafuente (stronk7)
d590b08dfa MDL-75880 phpunit: fix all @coversDefaultClass missing @covers
Because @coversDefaultClass doesn't indicate any coverage (it's
just an alias to avoid having to write the class name in @covers),
this commit fixes all the files that were using that annotation
and missing any @covers.

Basically, replacing one by the other and done.
2022-11-04 16:51:20 +01:00
Jake Dallimore
446a9e64f0 Merge branch 'MDL-76055' of https://github.com/stronk7/moodle 2022-11-04 12:06:38 +03:00
Andrew Nicols
426ea50861 MDL-76169 behat: Normalise exception message in should (not) steps
These steps have accepted a NodeElement instance as an argument for some
time, but were trying to cast it to string when formulating exception
messages, making it harder to debug and, in the case of the 'should see'
step, not work at all.

This patch introduces a new function to produce a consistent naming for
them.
2022-11-03 21:39:15 +08:00
Andrew Nicols
232ebac338 MDL-76169 behat: Add improved steps for using action menus
This commit adds new steps related to action menus to support:
* Choosing an item in a named action menu
* Choosing an item in a named action menu within a container
* Confirming that an action menu item does or does not exist in a named
  action menu
* Confirming that an action menu item does or does not exist in a named
  action menu within a container

The existing action menu steps were insufficient as they assume that
there is only one action menu within he container, which is not
necessarily the case.

The existing action menu steps are not non-JS friendly and will error if
JS is disabled, without providing any fallback when one is easily
available.

Unfortunately these steps cannot be used to replace the existing steps
without manual intervention.
2022-11-03 21:39:15 +08:00
Eloy Lafuente (stronk7)
a0d916bc86 MDL-76055 libraries: Autoload phpxmlrpc and verify it works
Also, we can now safely remove Autoloader.php, because
Moodle PSR-4 autoloader has taken control, so document
and test it too.
2022-11-02 15:56:38 +01:00
Marina Glancy
a34b4ebdc3 MDL-76112 various: can not pss null as 3rd param to preg_split
This produces notices in PHP 8.1
2022-10-28 10:51:20 +02:00
Jun Pataleta
c76a2a05ba Merge branch 'MDL-72558' of https://github.com/NoelDeMartin/moodle 2022-10-26 13:37:45 +08:00
Víctor Déniz
c209719811 Merge branch 'MDL-67020_master' of https://github.com/marxjohnson/moodle 2022-10-21 09:07:58 +03:00
Mark Johnson
ea01fb2427 MDL-67020 Cache: Make local caching work for coursemodinfo 2022-10-20 11:31:33 +01:00
Jun Pataleta
3a5205dd0a Merge branch 'MDL-75985-master' of https://github.com/andrewnicols/moodle 2022-10-19 21:27:29 +08:00
Andrew Nicols
0ba4fa53c1 MDL-75985 behat: Return newline character for \n
Somehow part of this commit was lost during the push and/or squash.
2022-10-19 20:26:14 +08:00
Jun Pataleta
e591f9da66 Merge branch 'MDL-75985-master' of https://github.com/andrewnicols/moodle 2022-10-19 10:56:14 +08:00
Sara Arjona
3c49d97f1c Merge branch 'MDL-75077' of https://github.com/paulholden/moodle 2022-10-17 16:32:29 +02:00
Ilya Tregubov
057f732bf1 Merge branch 'MDL-58266-master' of https://github.com/JBThong/moodle 2022-10-17 12:51:59 +03:00
Shamim Rezaie
9708ad500b Merge branch 'MDL-55580_master' of https://github.com/marxjohnson/moodle 2022-10-17 19:19:36 +11:00
Andrew Nicols
febd5d944c MDL-75985 behat: Standardise HTML output when comparing editor content
This commit adds a standardise_html function and updates the matches
function to compare normalised content.

This allows for a wider variety of valid editor output to be handled
using the standard value matching steps in Behat, thus supporting
editors other than Atto better.
2022-10-14 23:44:56 +08:00
Víctor Déniz
ab764c0062 Merge branch 'MDL-75736-master' of https://github.com/sammarshallou/moodle 2022-10-14 16:09:01 +01:00