614 Commits

Author SHA1 Message Date
Jun Pataleta
49393a1608
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:56:50 +08:00
Angelia Dela Cruz
e08630b394 MDL-78455 Behat: Behat cleanup and optimisation for blog/tests/behat 2023-06-16 09:19:13 +08:00
Angelia Dela Cruz
e4a8e344ba MDL-78455 Behat: Add Behat for adding, editing and deleting blog entries 2023-06-16 09:16:32 +08:00
Paul Holden
1818a6841b
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:56 +00:00
Michael Hawkins
313d44f83a MDL-76861 blog: Ensure correct escaping applied to search string 2023-01-12 11:43:11 +08:00
Tim Hunt
2ea89b98a7 MDL-76810 redirect handling: ensure return URLs are properly sanitised 2023-01-11 11:43:12 +08: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
Eloy Lafuente (stronk7)
8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00: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
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Paul Holden
d95812cb39 MDL-65584 blog: safer deletion of associations in privacy provider.
It's possible that the given context list contains no posts, which caused
an exception to be thrown when passing an empty array to get_in_or_equal.
2019-10-08 00:12:32 +01:00
Bas Brands
d470c68b1f MDL-65083 theme_boost: update uses of pull-xs-right 2019-08-19 08:16:47 +02:00
Juan Leyva
6c344ff282 MDL-64656 core_tag: Return tags in modules and blog 2019-04-11 10:20:44 +02:00
Andrew Nicols
4dbae58e87 MDL-63422 blog: Correct phpdoc for get_users 2018-11-02 08:34:20 +08:00
Andrew Nicols
f8e364e31a Merge branch 'MDL-63422' of git://github.com/stronk7/moodle 2018-11-02 08:22:33 +08:00
Mihail Geshoski
4acdbe5d0b MDL-63690 core_blog: Handle when user blog posts are not being returned 2018-10-31 11:44:09 +08:00
Eloy Lafuente (stronk7)
bd5fdcfccd MDL-63422 general: review core loop / switch / case / continue
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:

- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.

The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
  change to continue 2
- When it was not clear, keep old behavior switching to break, no
  matter how weird the behavior may be.
2018-10-31 00:17:59 +01:00
Adrian Greeve
799d32fd2d MDL-63690 core_blog: Update providers for userlist deletion. 2018-10-26 09:07:01 +08:00
Eloy Lafuente (stronk7)
6db31715b3 Merge branch 'MDL-61245-master' of git://github.com/jleyva/moodle 2018-10-10 11:14:57 +02:00
Juan Leyva
ca48cc915b MDL-61245 core_blog: New Web Service core_blog_view_entries 2018-10-10 09:58:08 +02:00
David Monllao
4e725169f9 MDL-60425 blog: Remove empty line 2018-10-08 12:52:04 +02:00
Juan Leyva
bb96ff716d MDL-60425 core_blog: New WS core_blog_get_entries 2018-10-02 14:49:48 +02:00
Juan Leyva
9de4402112 MDL-60425 core_blog: Move access validation to API 2018-10-02 14:49:48 +02:00
Mihail Geshoski
c69a43f2fc MDL-56998 blog: Remove associated blog posts when module is deleted 2018-09-03 08:33:38 +08:00
Víctor Déniz Falcón
02fda279ed MDL-57281 behat: deprecated step definition I navigate to node in
Definition step deprecated and affected tests modified.
2018-08-20 12:53:26 +01:00
David Mudrák
c4e7c3cac4 MDL-62619 privacy: Fix a missing alias in the blog provider class
The new implementation revealed another existing bug that did not expose
before due to coincidently same named table alias in the outer query.
2018-07-27 10:14:43 +02:00
Marina Glancy
468c8d39c3 MDL-62351 privacy: check that subsystem/plugintype exist 2018-05-09 17:37:31 +08:00
Marina Glancy
2207b0fa9f MDL-62068 core_tag: implement privacy API 2018-05-08 11:30:54 +08:00
Adrian Greeve
8c6fae4e9c MDL-62035 core_blog: Update to blog with comments.
This makes blog use the updated delete methods in the
comments provider.
2018-04-20 10:42:43 +08:00
Andrew Nicols
7072009431 MDL-61836 blog: Fix random order failures 2018-04-20 08:56:05 +08:00
Frédéric Massart
0288333c0b MDL-61836 core_blog: Prevent randomness in comments order 2018-04-20 08:56:05 +08:00
Frédéric Massart
ce1ec9b4d9 MDL-61836 core_blog: Implement privacy API 2018-04-13 13:22:03 +08:00
Marina Glancy
99fbcc7bd4 MDL-58670 blog: respect capability to search entries 2017-05-03 10:49:01 +08:00
Marina Glancy
b7fcd09582 MDL-58635 blogs: check edited blog belongs to current user 2017-05-03 10:49:01 +08:00
Simey Lameze
fdeeaff954 MDL-58265 core_test: replace I turn editing on steps
Also remove few more unnecessary steps that redirects behat to
site home page to actually get to the course.

Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00