Commit Graph

92 Commits

Author SHA1 Message Date
Jun Pataleta 820b16f97d Merge branch 'MDL-84652-main' of https://github.com/davewoloszyn/moodle 2025-03-07 10:54:11 +08:00
Daniel Ziegenberg c3af0680e2 MDL-84652 core_auth: Remove auth_mnet dependencies
- Remove auth_mnet from the standard plugins
- PHP Unit:
  - Remove auth_mnet as a sample from unit testing in login tests
    and component tests replacing it with auth_ldap.
  - Conditionally skip tests for block mnet_hosts when auth_mnet is
    not installed.

Original issue: MDL-84307

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-03-07 10:50:47 +08:00
Daniel Ziegenberg 60f7db3a93 MDL-84652 core: Remove block_mnet_hosts dependencies
- Remove block_mnet_hosts from the standard plugins
- Remove block_mnet_hosts from default admin presets
- Replace block_mnet_hosts in behat tests of core features

Original issue: MDL-84309

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2025-03-07 10:49:58 +08:00
Safat 001c5361d3 MDL-78778 auth_cas: Uninstall cas & remove dependencies 2025-03-05 12:53:58 +11:00
Andrew Nicols 2d9c877f58 MDL-79843 core: Fully reset the component cache for some tests 2025-01-29 14:39:50 +08:00
Jake Dallimore 16690e3c88 MDL-79843 core: add component tests covering plugintype deprecation
Note: these tests impact \core\component caches and must be run in a
separate process to prevent impact on other tests.
2025-01-28 14:42:19 +08:00
Andrew Nicols b95a8c6ecc MDL-83468 phpunit: Fix data provider param names 2025-01-20 16:47:55 +01:00
Andrew Nicols 84532b7667 MDL-83705 core: Update subplugins.json relative to plugin 2024-12-19 09:03:00 +07:00
Andrew Nicols 6ab400b733 MDL-83703 core: Remove support for subplugins.php 2024-12-02 10:08:28 +08:00
Andrew Nicols 426471917f MDL-83703 core: Add unit tests for subplugin fetching 2024-12-02 10:08:28 +08:00
Jun Pataleta 4e22073a9b MDL-83811 core: Make sure to trim leading backslashes too for Windows 2024-11-27 10:36:46 +08:00
Andrew Nicols 09e4f29fbd MDL-82824 core: Add unit test to ensure completeness of Autoloader 2024-11-04 11:49:47 +08:00
Andrew Nicols 10c3e4b770 MDL-81924 core_sms: Add new subsystem and plugintype
Originally implemented as MDL-80960.
2024-09-23 10:43:39 +07:00
Matt Porritt 086ac975f0 MDL-82627 AI: LMS Subsystem
Initial implementation of the LMS AI subsystem.
Originally implemented in MDL-80889

Co-authored-by: Meirza <meirza.arson@moodle.com>
2024-09-11 11:02:51 +07:00
lameze d04a05b98f MDL-82287 phpunit: use the correct component 2024-07-18 13:53:17 +08:00
Huong Nguyen db5b60424b Merge branch 'MDL-82287-main' of https://github.com/andrewnicols/moodle 2024-07-18 09:47:01 +07:00
Andrew Nicols 0270c90dc0 MDL-66903 core: Introduce \core\component::resetto replace hacks
Traditionally we have done this using reflection and it would be better
to do this in a 'proper' fashion in case we ever need to change how it
works.
2024-07-15 13:07:42 +08:00
Andrew Nicols 25df1ed645 MDL-66903 core: Move core_component to \core\component 2024-07-15 13:07:42 +08:00
Andrew Nicols 406dcd2566 MDL-66903 testing: Add support for a \tests\ namespace during tests
This commit:
- introduces a \tests\ sub-namespace for use in unit tests only
- the path to this the tests/classes directory of the owning parent
- files here are excluded from unit test runs

This is agreed per policy in MDL-80855.
2024-07-15 13:07:36 +08:00
Andrew Nicols 3c03e9448c MDL-66903 testing: Fix whitespace 2024-07-15 12:23:05 +08:00
Amaia Anabitarte f9497ceade MDL-81771 core_report: Add Report as subsystem 2024-07-03 15:47:46 +02:00
Andrew Nicols 77f9238cf4 MDL-82287 core: Deprecate long-deprecated functions
These were originally believed to be so widely used that we could never
migrate away from them but it seems we have!
2024-06-26 22:19:07 +08:00
Sara Arjona 5e8f48a53f Merge branch 'MDL-81209-main' of https://github.com/andrewnicols/moodle 2024-04-23 15:35:12 +02:00
Andrew Nicols 6db4285eaa MDL-81525 core_user: Move after_complete_login to correct NS 2024-04-15 13:05:10 +08:00
Andrew Nicols dae36f6cfa MDL-81063 core: Add helper to get component name from classname 2024-04-10 12:41:31 +08:00
Andrew Nicols 29fc61c2a5 MDL-81063 core: Add option to get core in list of components 2024-04-10 12:41:31 +08:00
Andrew Nicols dc0cf1f273 MDL-81209 core: Unit test should not care about plugin details 2024-04-08 20:54:48 +08:00
Juan Leyva 8ed83886f3 MDL-81405 tool_mobile: Set Partitioned cookie for the mobile app 2024-04-06 12:21:00 +02:00
Juan Leyva 8b30632b31 MDL-80332 tool_mobile: Fallback por app launches 2024-03-25 15:48:40 +01: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
Marina Glancy e9abb3a5de MDL-79076 output: convert callback before_standard_html_head 2024-01-15 15:33:42 +00:00
Andrew Nicols 846892ab07 MDL-79697 core: Coding style updates 2023-11-15 21:24:31 +08:00
Andrew Nicols db556a4ce8 MDL-79697 core: PSR-4 NS can be spread across multiple dirs
The PSR-4 specification does not preclude a single namespaces from
having multiple sources. This is the case for several PSR standards
including standard packagist packages distributed by PSR:

- PSR-7 - HTTP Message Interfaces: \Psr\Http\Message
- PSR-17 - HTTP Factories: \Psr\Http\Message
- PSR-15 - http-server-handler: \Psr\Http\Server
- PSR-15 - http-server-middleware: \Psr\Http\Server
2023-11-15 21:23:27 +08:00
Huong Nguyen 36677cd883 Merge branch 'MDL-79739-master' of https://github.com/andrewnicols/moodle 2023-11-08 09:23:37 +07:00
Andrew Nicols 06965b823e MDL-79739 core: Only run some tests in separate processes 2023-10-17 12:18:37 +08:00
Andrew Nicols 9942c14856 MDL-79698 core: Correct duplicate array key in test provider 2023-10-13 15:43:47 +08:00
Meirza b7008d33ea MDL-78167 lib: Added missing class properties in tests
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.

Adding @runTestsInSeparateProcesses and removing setUp() and tearDown() at the
component_test.php, so the test will run in a separate process making sure that
whatever changes happen to the in-memory version of the component class in its thread,
therefore does not impact other tests and makes it more safe.
2023-05-27 09:24:59 +07:00
Huong Nguyen 163b4134df MDL-77576 core: Register new communication sub-system
Create a new subsystem for communication and create
associated experimental settings to safely use the
new subsystem.

Originally implemented as MDL-76699.

Co-Authored-By: Huong Nguyen <huongnv13@gmail.com>
2023-05-05 14:41:28 +10:00
Peter Burnett 027c770eab MDL-65471 upgrade: framework to reduce maintenance mode 2023-04-06 11:38:26 +10:00
Jun Pataleta cd0afd5c76 MDL-77105 core: Method to determine whether a plugin has monolog icons 2023-03-27 13:32:09 +08:00
Eloy Lafuente (stronk7) ef936717ee MDL-77607 core_component: Fix wrong component for the grade api
The correct component (subsystem) for the "grade" API is
"core_grades" not "core_grade".

Let's fix that and cover it with tests.
2023-03-17 19:27:14 +01:00
Meirza e2cd808b34 MDL-76415 core: Fixed ${var} string interpolation deprecations.
Since PHP 8.2, placing the dollar sign outside the curly brace is deprecated when
the expression inside the braces resolves to a variable or an expression.
2023-02-13 19:51:46 +07:00
Andrew Nicols 93ab932211 MDL-76362 core: plugin names must be strings to be valid 2023-01-23 09:15:55 +08:00
Andrew Nicols e068f2284f MDL-76362 core: Update core_component plugin name tests 2023-01-23 09:15:55 +08:00
Andrew Nicols 4a2793002c MDL-76583 core_external: Add new core_external subsystem 2023-01-17 10:59:15 +08:00
Eloy Lafuente (stronk7) 28937d4243 MDL-71096 core: Add meta information about APIs to core
Right now we have the information only in docs:
  - https://docs.moodle.org/dev/Core_APIs
  - https://moodledev.io/docs/apis

And, in fact, we are crawling those pages to get the information
from various tools (moodlecheck, CiBoT...). Obviously, that's far
from ideal, the source only has the current list of APIs, and
there isn't much information there but the names.

So we are moving the source of information to be in core, so it
can be modified between branches, and contains richer information:
 - The component the API belongs to, usually a subsystem or core.
 - If the API can be used as level 2 namespace.
 - If the API can be used as level 2 namespace out from its component.

Note that all that information has NO USES right now in core (and maybe
never will), but tools/checkers will benefit enormously by having that
information at hand, so we can check for namespaces, categories and
other bits way better.

Also, once we have this, the APIs dev documents linked above, surely
can be improved by being automatically generated and include all the
meta-information available.

It also includes a very basic json schema validating the basis. It can
be tried online @ https://www.jsonschemavalidator.net , or any other
tool. PHP requires extra libraries to be able to perform the validation.

Covered with unit tests, both api-related functions and structure validation.
2022-12-09 10:49:12 +01:00
Sara Arjona 727f0d4daf MDL-73397 adminpresets: Create new core_adminpresets component
The core_adminpresets component has been added and some data and
methods from the tool_admin_presets have been moved here.
2022-01-03 11:51:33 +01:00
Paul Holden 542f2927f7 MDL-70794 reportbuilder: register new core sub-system.
In addition to housekeeping for the new sub-system, define our
table schema to be used in later persistents.
2021-07-28 16:40:50 +01:00
Ferran Recio 21d93554d4 MDL-71863 courseformat: create courseformat subsystem 2021-06-28 13:50:18 +02:00
Eloy Lafuente (stronk7) 309a65a6f7 MDL-71036 phpunit: Renamed various file-related assertions
In PHPUnit 9.1, the following file-related assertions
have been deprecated and there are new alternatives for
all them:
- assertNotIsReadable()         -> assertIsNotReadable()
- assertNotIsWritable()         -> assertIsNotWritable()
- assertDirectoryNotExists()    -> assertDirectoryDoesNotExist()
- assertDirectoryNotIsReadable()-> assertDirectoryIsNotReadable()
- assertDirectoryNotIsWritable()-> assertDirectoryIsNotWritable()
- assertFileNotExists()         -> assertFileDoesNotExist()
- assertFileNotIsReadable()     -> assertFileIsNotReadable()
- assertFileNotIsWritable()     -> assertFileIsNotWritable()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

ag 'assertNotIsReadable|assertNotIsWritable|assertDirectoryNotExists|\
assertDirectoryNotIsReadable|assertDirectoryNotIsWritable|\
assertFileNotExists|assertFileNotIsReadable|assertFileNotIsWritable'
2021-03-11 19:22:23 +01:00