644 Commits

Author SHA1 Message Date
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
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
871aa5e978
MDL-65978 blog: Fix unit tests (remove hardcoded entry ids) 2024-03-07 13:46:07 +01:00
Juan Leyva
fc0f94626e
MDL-65978 blog: Fix removing associations 2024-03-07 11:58:22 +01:00
Juan Leyva
166afa05fe MDL-65978 blog: New WS core_blog_update_entry 2024-02-29 16:18:21 +01:00
Juan Leyva
4b3bda1657 MDL-65978 blog: New WS prepare_entry_for_edition 2024-02-29 16:18:21 +01:00
Juan Leyva
b43b16c358 MDL-65978 blog: New WS core_blog_delete_entry 2024-02-29 16:18:21 +01:00
Juan Leyva
5a679bffd2 MDL-65978 blog: New WS core_blog_add_entry 2024-02-29 16:18:21 +01:00
Juan Leyva
b6b2077e60 MDL-65978 blog: New WS core_blog_get_access_information 2024-02-29 16:18:21 +01:00
Juan Leyva
98daf57a8d MDL-65978 blog: Preparatory API changes 2024-02-29 16:18:21 +01: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
Paul Holden
e187e13947
MDL-80098 core: correct arguments for invalidmoduleid exceptions.
The "invalid module ID" should be passed as the `$a` constructor
argument.
2024-01-17 08:58:49 +00:00
Paul Holden
f6c918a50f
MDL-79532 blog: add "title with link" column to report entity. 2024-01-05 09:37:56 +00:00
Paul Holden
3dec3fb8ce
MDL-79397 reportbuilder: update reports to use auto-generated aliases.
We no longer need to be concerned about the manual setting of entity
table aliases (e.g. to avoid duplication between entities, or for using
a single entity multiple times), as it's handled transparently for us.
2023-12-07 17:19:01 +00:00
Paul Holden
7143cf4cbc
MDL-79397 reportbuilder: update existing entity table definitions. 2023-12-07 17:19:01 +00:00
Paul Holden
6b712f5b46
MDL-79536 blog: clarify language around published report column/filter.
Avoid the use of "Yourself" when refering to the draft state of a blog
post, as it can mistakenly be interpreted as referring to the current
user (rather than the user who authored the blog post).
2023-11-02 10:48:11 +00:00
Jun Pataleta
1eb8ee32bb
MDL-78806 core: Remove redundant site name
MDL-78806 core: Remove redundant site name on page titles

* With the site name now being appended to the page titles, there
is no need to manually append the page titles.
2023-09-09 08:58:54 +08:00
Paul Holden
33a63ca639
MDL-76295 reportbuilder: implement default datasource sorting.
Update all existing report sources to use the new default sorting
API from 064eccd4, updating existing tests to assert behaviour.
2023-08-23 15:32:50 +01:00
Sara Arjona
675569572d
Merge branch 'MDL-78455-master' of https://github.com/andelacruz/moodle 2023-07-13 16:49:58 +02:00
Paul Holden
e8ae9680bc
MDL-75810 reportbuilder: entity method for returning tag SQL joins. 2023-06-16 18:21:24 +01:00
Angelia Dela Cruz
89e0885660 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:06:07 +08:00
Angelia Dela Cruz
1325ddac92 MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-15 15:25:36 +08:00
Ilya Tregubov
dfc0b2a2fd
Merge branch 'MDL-77700' of https://github.com/paulholden/moodle 2023-05-17 15:14:22 +08:00
Meirza
2fb9f3ab02 MDL-77350 blog: 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
Paul Holden
ea404b8e37
MDL-77700 blog: add comment author data to custom report source.
The ability to report on blog comments was added in 27ebde57, however
it lacked the option to report on the user who added the comment(s).

AMOS BEGIN
 CPY [author,core_notes],[author,core_blog]
AMOS END
2023-05-04 09:12:50 +01:00
Andrew Nicols
29a48b540c Merge branch 'MDL-77539' of https://github.com/paulholden/moodle 2023-03-09 10:09:29 +08:00
Mathew May
e5ca7766e7 MDL-52805 core: Remove legacy log calls 2023-03-07 13:08:46 +08:00
Paul Holden
76a48c8270
MDL-77539 blog: null coalesce external blog form name/description.
We can't pass null to most string related functions (e.g. `trim`) in
PHP8.1 onwards.
2023-03-06 14:49:07 +00:00
Paul Holden
76327f04ac MDL-76591 comment: create test generators and Behat scenarios.
The added scenarios cover the management of comments: viewing,
filtering and deletion.
2023-01-30 16:00:25 +00:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Michael Hawkins
71564e3e70 MDL-76861 blog: Ensure correct escaping applied to search string 2023-01-12 11:42:51 +08:00
Tim Hunt
3b23ff6fec MDL-76810 redirect handling: ensure return URLs are properly sanitised 2023-01-11 11:42:28 +08:00
Sara Arjona
bb883d95aa Merge branch 'MDL-76153' of https://github.com/paulholden/moodle 2022-12-28 18:50:28 +01:00
Paul Holden
27ebde570f MDL-76153 blog: add comments to blogs custom report source. 2022-12-20 09:32:11 +00:00
Paul Holden
224b3ab51f MDL-76154 blog: add files/attachments to custom report source. 2022-12-20 09:31:29 +00:00
Paul Holden
4b007efda5 MDL-75038 blog: link back to user only when one specified. 2022-11-01 21:27:03 +00:00
Jun Pataleta
4caae7c835 MDL-75358 blog: Make attachment callback parameter nullable 2022-10-31 22:58:40 +08:00
Paul Holden
a82b83c2fb MDL-75166 blog: implement blogs datasource for custom reporting.
Create entity definition containing report elements for blog posts.
Add new report source joining the entity to existing user, course
and tag entities to provide data for the reportbuilder editor.
2022-10-19 14:53:08 +01:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Noel De Martin
2944abad29 MDL-75084 blog: Implement behat generators 2022-06-29 09:39:39 +02:00
Jake Dallimore
041b1beb46 Merge branch 'MDL-73347-master' of https://github.com/sarjona/moodle 2022-01-24 13:40:57 +08:00
Eloy Lafuente (stronk7)
0c53a3dec8 MDL-73476 phpunit: events, external and search tescase names
All events_test, external_test and search_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- 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 lib/external/tests/external_test.php:
- external is not a valid component
- hence, its only valid namespace is "core"
- also, it's testing lib/external/externallib.php
- hence, the file (and class) have been renamed to external_externallib_test.php
  (to avoid conflicts with other external_test that may exist in core)
2022-01-14 16:18:39 +01:00
Sara Arjona
53fe23d8b5 MDL-73347 behat: Add blocks hidden by default for boost
For the boost them, a few themes have been hidden by default.
The unaddable setting should be set to let admins add them again,
because some behat tests need them.
2022-01-14 13:08:48 +01:00
Eloy Lafuente (stronk7)
511801cb46 MDL-73352 phpunit: lib_test and locallib_test testcase names
All lib_test and locallib_test classes:

- Namespaced with component (and API whenever makes sense).
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed or add new uses.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under login/tests:

1) The core_login component doesn't exist.
2) But login/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have login_xxxx as prefix.
2021-12-30 16:21:42 +01: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
Mihail Geshoski
d000b16a72 MDL-72287 report: Add back link and headings in user profile pages 2021-12-09 22:46:57 +08:00
Marina Glancy
e1ab67836d MDL-71394 core_blog: fix incorrect default setting in form
the keys of the options are strings, in PHP8 strings are compared with 0 differently
2021-04-21 16:22:22 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00