Merge branch 'MDL-87950-main' of https://github.com/andrewnicols/moodle
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"audit": {
|
||||
"block-insecure": false
|
||||
},
|
||||
"allow-plugins": {
|
||||
"moodle/composer-installer": true,
|
||||
"moodle/moodle-composer-scaffold": true
|
||||
|
||||
+50
-1
@@ -47,7 +47,51 @@
|
||||
"ext-json": "*",
|
||||
"ext-hash": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-sodium": "*"
|
||||
"ext-sodium": "*",
|
||||
"psr/container": "2.0.2",
|
||||
"psr/http-client": "1.0.3",
|
||||
"psr/http-factory": "1.1.0",
|
||||
"psr/http-message": "2.0.0",
|
||||
"psr/log": "3.0.2",
|
||||
"psr/http-server-handler": "1.0.2",
|
||||
"psr/http-server-middleware": "1.0.2",
|
||||
"psr/event-dispatcher": "1.0.0",
|
||||
"psr/simple-cache": "3.0.0",
|
||||
"slim/slim": "4.13.0",
|
||||
"nikic/fast-route": "1.3.0",
|
||||
"psr/cache": "3.0.0",
|
||||
"guzzlehttp/guzzle": "7.9.2",
|
||||
"guzzlehttp/promises": "2.0.4",
|
||||
"guzzlehttp/psr7": "2.7.0",
|
||||
"symfony/deprecation-contracts": "3.6.0",
|
||||
"kevinrob/guzzle-cache-middleware": "6.0.0",
|
||||
"laravel/serializable-closure": "2.0.3",
|
||||
"php-di/php-di": "7.0.8",
|
||||
"php-di/invoker": "2.3.6",
|
||||
"monolog/monolog": "3.9.0",
|
||||
"composer/pcre": "3.3.2",
|
||||
"maennchen/zipstream-php": "3.2.0",
|
||||
"psr/clock": "1.0.0",
|
||||
"firebase/php-jwt": "6.11.1",
|
||||
"ezyang/htmlpurifier": "4.18.0",
|
||||
"matthiasmullie/minify": "1.3.75",
|
||||
"matthiasmullie/path-converter": "1.1.3",
|
||||
"phpmailer/phpmailer": "6.9.3",
|
||||
"simplepie/simplepie": "1.8.1",
|
||||
"aws/aws-sdk-php": "3.356.22",
|
||||
"mtdowling/jmespath.php": "2.8.0",
|
||||
"spatie/php-cloneable": "1.0.2",
|
||||
"lbuchs/webauthn": "2.2.0",
|
||||
"adodb/adodb-php": "5.22.9",
|
||||
"html2text/html2text": "4.3.2",
|
||||
"michelf/php-markdown": "2.0.0",
|
||||
"mustache/mustache": "3.0.0",
|
||||
"openspout/openspout": "4.28.5",
|
||||
"geoip2/geoip2": "3.2.0",
|
||||
"maxmind-db/reader": "1.12.1",
|
||||
"redeyeventures/geopattern": "1.1.2",
|
||||
"phpxmlrpc/phpxmlrpc": "4.11.1",
|
||||
"ralouphie/getallheaders": "3.0.3"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mysqli": "Needed when Moodle uses MySQL or MariaDB database.",
|
||||
@@ -56,5 +100,10 @@
|
||||
"ext-tokenizer": "Enabling Tokenizer PHP extension is recommended, it improves Moodle Networking functionality.",
|
||||
"ext-soap": "Enabling SOAP PHP extension is useful for web services and some plugins.",
|
||||
"ext-exif": "Enabling Exif PHP extension is recommended, it is used by Moodle to parse image meta data."
|
||||
},
|
||||
"config": {
|
||||
"audit": {
|
||||
"block-insecure": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+3172
-386
File diff suppressed because it is too large
Load Diff
@@ -185,13 +185,18 @@ class component {
|
||||
* @var array<string>
|
||||
*/
|
||||
protected static $composerautoloadfiles = [
|
||||
'public/lib/aws-sdk/src/functions.php',
|
||||
'public/lib/guzzlehttp/guzzle/src/functions_include.php',
|
||||
'public/lib/jmespath/src/JmesPath.php',
|
||||
'public/lib/nikic/fast-route/src/functions.php',
|
||||
'public/lib/php-di/php-di/src/functions.php',
|
||||
'public/lib/ralouphie/getallheaders/src/getallheaders.php',
|
||||
'public/lib/symfony/deprecation-contracts/function.php',
|
||||
// The AWS SDK always defines functions, even if they already exist.
|
||||
'public/lib/aws-sdk/src/functions.php' => [
|
||||
'Aws\describe_region_info',
|
||||
],
|
||||
|
||||
// The following files check if functions have already been defined.
|
||||
'public/lib/guzzlehttp/guzzle/src/functions_include.php' => true,
|
||||
'public/lib/jmespath/src/JmesPath.php' => true,
|
||||
'public/lib/nikic/fast-route/src/functions.php' => true,
|
||||
'public/lib/php-di/php-di/src/functions.php' => true,
|
||||
'public/lib/ralouphie/getallheaders/src/getallheaders.php' => true,
|
||||
'public/lib/symfony/deprecation-contracts/function.php' => true,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -216,7 +221,13 @@ class component {
|
||||
|
||||
// Load any composer-driven autoload files.
|
||||
// This is intended to mimic the behaviour of the standard Composer Autoloader.
|
||||
foreach (static::$composerautoloadfiles as $file) {
|
||||
foreach (static::$composerautoloadfiles as $file => $test) {
|
||||
if (is_array($test)) {
|
||||
if (array_filter($test, fn ($function): bool => !function_exists($function))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$path = dirname(__DIR__, 3) . '/' . $file;
|
||||
if (file_exists($path)) {
|
||||
require_once($path);
|
||||
@@ -607,7 +618,6 @@ class component {
|
||||
* Create cache file content.
|
||||
*
|
||||
* @private this is intended for $CFG->alternative_component_cache only.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_cache_content() {
|
||||
@@ -766,8 +776,11 @@ $cache = ' . var_export($cache, true) . ';
|
||||
foreach (['deprecatedplugintypes', 'deletedplugintypes'] as $key) {
|
||||
$illegaltypes = array_intersect(self::$supportsubplugins, array_keys($plugintypesmap[$key]));
|
||||
if (!empty($illegaltypes)) {
|
||||
debugging("Deprecation of a plugin type which supports subplugins is not supported. These plugin types will ".
|
||||
"continue to be treated as active.", DEBUG_DEVELOPER);
|
||||
debugging(
|
||||
"Deprecation of a plugin type which supports subplugins is not supported. "
|
||||
. "These plugin types will continue to be treated as active.",
|
||||
DEBUG_DEVELOPER
|
||||
);
|
||||
foreach ($illegaltypes as $plugintype) {
|
||||
$plugintypesmap['plugintypes'][$plugintype] = $plugintypesmap[$key][$plugintype];
|
||||
unset($plugintypesmap[$key][$plugintype]);
|
||||
@@ -796,8 +809,11 @@ $cache = ' . var_export($cache, true) . ';
|
||||
'deletedplugintypes' => $allsubtypes['deletedplugintypes'] ?? [],
|
||||
];
|
||||
|
||||
if (!$subplugintypesdata['plugintypes'] && !$subplugintypesdata['deprecatedplugintypes']
|
||||
&& !$subplugintypesdata['deletedplugintypes']) {
|
||||
if (
|
||||
!$subplugintypesdata['plugintypes']
|
||||
&& !$subplugintypesdata['deprecatedplugintypes']
|
||||
&& !$subplugintypesdata['deletedplugintypes']
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$subplugintypesmap['plugintypes'][$type . '_' . $plugin] = [];
|
||||
@@ -806,9 +822,11 @@ $cache = ' . var_export($cache, true) . ';
|
||||
|
||||
foreach ($subplugintypesdata as $key => $subplugintypes) {
|
||||
foreach ($subplugintypes as $subtype => $subdir) {
|
||||
if (isset($plugintypesmap['plugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deprecatedplugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deletedplugintypes'][$subtype])) {
|
||||
if (
|
||||
isset($plugintypesmap['plugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deprecatedplugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deletedplugintypes'][$subtype])
|
||||
) {
|
||||
error_log("Invalid subtype '$subtype', duplicate detected.");
|
||||
continue;
|
||||
}
|
||||
@@ -834,8 +852,11 @@ $cache = ' . var_export($cache, true) . ';
|
||||
'deprecatedplugintypes' => $allsubtypes['deprecatedplugintypes'] ?? [],
|
||||
'deletedplugintypes' => $allsubtypes['deletedplugintypes'] ?? [],
|
||||
];
|
||||
if (!$subplugintypesdata['plugintypes'] && !$subplugintypesdata['deprecatedplugintypes']
|
||||
&& !$subplugintypesdata['deletedplugintypes']) {
|
||||
if (
|
||||
!$subplugintypesdata['plugintypes']
|
||||
&& !$subplugintypesdata['deprecatedplugintypes']
|
||||
&& !$subplugintypesdata['deletedplugintypes']
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$subplugintypesmap['plugintypes'][$type . '_' . $plugin] = [];
|
||||
@@ -844,9 +865,11 @@ $cache = ' . var_export($cache, true) . ';
|
||||
|
||||
foreach ($subplugintypesdata as $key => $subplugintypes) {
|
||||
foreach ($subplugintypes as $subtype => $subdir) {
|
||||
if (isset($plugintypesmap['plugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deprecatedplugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deletedplugintypes'][$subtype])) {
|
||||
if (
|
||||
isset($plugintypesmap['plugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deprecatedplugintypes'][$subtype])
|
||||
|| isset($plugintypesmap['deletedplugintypes'][$subtype])
|
||||
) {
|
||||
error_log("Invalid subtype '$subtype', duplicate detected.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -86,9 +86,6 @@ class di {
|
||||
protected static function create_container(): ContainerInterface {
|
||||
global $CFG;
|
||||
|
||||
// PHP Does not support function autoloading. We must manually include the file.
|
||||
require_once("{$CFG->libdir}/php-di/php-di/src/functions.php");
|
||||
|
||||
// Configure the Container builder.
|
||||
$builder = new \DI\ContainerBuilder();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
"dev-main": "3.6-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
|
||||
@@ -29,9 +29,8 @@ use ReflectionProperty;
|
||||
* @category test
|
||||
* @copyright 2013 Petr Skoda {@link http://skodak.org}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*
|
||||
* @covers \core\component
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(component::class)]
|
||||
final class component_test extends \advanced_testcase {
|
||||
use fake_plugins_test_trait;
|
||||
|
||||
@@ -47,7 +46,7 @@ final class component_test extends \advanced_testcase {
|
||||
* this is defined here to annoy devs that try to add more without any thinking,
|
||||
* always verify that it does not collide with any existing add-on modules and subplugins!!!
|
||||
*/
|
||||
const SUBSYSTEMCOUNT = 80;
|
||||
private const SUBSYSTEMCOUNT = 80;
|
||||
|
||||
public function test_get_core_subsystems(): void {
|
||||
global $CFG;
|
||||
@@ -243,11 +242,10 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test that the get_plugin_list_with_file() function returns the correct list of plugins.
|
||||
*
|
||||
* @covers \core\component::is_valid_plugin_name
|
||||
* @dataProvider is_valid_plugin_name_provider
|
||||
* @param array $arguments
|
||||
* @param bool $expected
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('is_valid_plugin_name_provider')]
|
||||
public function test_is_valid_plugin_name(array $arguments, bool $expected): void {
|
||||
$this->assertEquals($expected, component::is_valid_plugin_name(...$arguments));
|
||||
}
|
||||
@@ -341,10 +339,10 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test \core_component::normalize_component function.
|
||||
*
|
||||
* @dataProvider normalise_component_provider
|
||||
* @param array $expected
|
||||
* @param string $args
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('normalise_component_provider')]
|
||||
public function test_normalize_component(array $expected, string $args): void {
|
||||
$this->assertSame(
|
||||
$expected,
|
||||
@@ -355,10 +353,10 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test the deprecated normalize_component function.
|
||||
*
|
||||
* @dataProvider normalise_component_provider
|
||||
* @param array $expected
|
||||
* @param string $args
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('normalise_component_provider')]
|
||||
public function test_deprecated_normalize_component(array $expected, string $args): void {
|
||||
$this->assertSame(
|
||||
$expected,
|
||||
@@ -435,11 +433,10 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Unit tests for get_component_from_classname.
|
||||
*
|
||||
* @dataProvider get_component_from_classname_provider
|
||||
* @param string $classname The class name to test
|
||||
* @param string|null $expected The expected component
|
||||
* @covers \core\component::get_component_from_classname
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('get_component_from_classname_provider')]
|
||||
public function test_get_component_from_classname(
|
||||
string $classname,
|
||||
string|null $expected,
|
||||
@@ -623,10 +620,10 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test that the get_component_classes_in_namespace() function returns classes in the correct namespace.
|
||||
*
|
||||
* @dataProvider get_component_classes_in_namespace_provider
|
||||
* @param array $methodargs
|
||||
* @param string $expectedclassnameformat
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('get_component_classes_in_namespace_provider')]
|
||||
public function test_get_component_classes_in_namespace_provider(
|
||||
array $methodargs,
|
||||
string $expectedclassnameformat,
|
||||
@@ -809,13 +806,13 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test the classloader.
|
||||
*
|
||||
* @dataProvider classloader_provider
|
||||
* @param array $psr0 The PSR-0 namespaces to be used in the test.
|
||||
* @param array $psr4 The PSR-4 namespaces to be used in the test.
|
||||
* @param string $classname The name of the class to attempt to load.
|
||||
* @param string $includedfiles The file expected to be loaded.
|
||||
* @runInSeparateProcess
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('classloader_provider')]
|
||||
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
|
||||
public function test_classloader($psr0, $psr4, $classname, $includedfiles): void {
|
||||
$psr0namespaces = new ReflectionProperty(component::class, 'psr0namespaces');
|
||||
$psr0namespaces->setValue(null, $psr0);
|
||||
@@ -1000,13 +997,13 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test the PSR classloader.
|
||||
*
|
||||
* @dataProvider psr_classloader_provider
|
||||
* @param array $psr0 The PSR-0 namespaces to be used in the test.
|
||||
* @param array $psr4 The PSR-4 namespaces to be used in the test.
|
||||
* @param string $classname The name of the class to attempt to load.
|
||||
* @param string|bool $file The expected file corresponding to the class or false for nonexistant.
|
||||
* @runInSeparateProcess
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('psr_classloader_provider')]
|
||||
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
|
||||
public function test_psr_classloader($psr0, $psr4, $classname, $file): void {
|
||||
return;
|
||||
$psr0namespaces = new ReflectionProperty(component::class, 'psr0namespaces');
|
||||
@@ -1067,13 +1064,13 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test the PSR classloader.
|
||||
*
|
||||
* @dataProvider get_class_file_provider
|
||||
* @param string $classname the name of the class.
|
||||
* @param string $prefix The namespace prefix used to identify the base directory of the source files.
|
||||
* @param string $path The relative path to the base directory of the source files.
|
||||
* @param string[] $separators The characters that should be used for separating.
|
||||
* @param string|bool $result The expected result to be returned from get_class_file.
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('get_class_file_provider')]
|
||||
public function test_get_class_file($classname, $prefix, $path, $separators, $result): void {
|
||||
$component = new ReflectionClass(component::class);
|
||||
$psrclassloader = $component->getMethod('get_class_file');
|
||||
@@ -1111,10 +1108,10 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Test the get_component_names() method.
|
||||
*
|
||||
* @dataProvider get_component_names_provider
|
||||
* @param bool $includecore Whether to include core in the list.
|
||||
* @param bool $coreexpected Whether core is expected to be in the list.
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('get_component_names_provider')]
|
||||
public function test_get_component_names(
|
||||
bool $includecore,
|
||||
bool $coreexpected,
|
||||
@@ -1219,7 +1216,6 @@ final class component_test extends \advanced_testcase {
|
||||
$this->assertNull($attributes->component, $message);
|
||||
}
|
||||
|
||||
|
||||
// Now check for the rest of attributes.
|
||||
$this->assertIsBool($attributes->allowedlevel2, $message);
|
||||
$this->assertIsBool($attributes->allowedspread, $message);
|
||||
@@ -1243,8 +1239,6 @@ final class component_test extends \advanced_testcase {
|
||||
|
||||
/*
|
||||
* Tests the getter for the db directory summary hash.
|
||||
*
|
||||
* @covers \core\component::get_all_directory_hashes
|
||||
*/
|
||||
public function test_get_db_directories_hash(): void {
|
||||
$initial = component::get_all_component_hash();
|
||||
@@ -1313,11 +1307,11 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Summary of test_composer_files
|
||||
*
|
||||
* @dataProvider core_thirdparty_libs_with_composer_provider
|
||||
* @param string $name
|
||||
* @param string $fullpath
|
||||
* @param string $relativepath
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('core_thirdparty_libs_with_composer_provider')]
|
||||
public function test_composer_files(
|
||||
string $name,
|
||||
string $fullpath,
|
||||
@@ -1375,15 +1369,6 @@ final class component_test extends \advanced_testcase {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the composer autoload files are present.
|
||||
if (array_key_exists('files', $composer['autoload'])) {
|
||||
// The Moodle composer file autoloads are a simple string[].
|
||||
$autoloadnamefiles = $rc->getProperty('composerautoloadfiles')->getValue(null);
|
||||
foreach ($composer['autoload']['files'] as $file) {
|
||||
$this->assertContains(trim($relativepath, '/\\') . "/{$file}", $autoloadnamefiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1501,10 +1486,10 @@ final class component_test extends \advanced_testcase {
|
||||
/**
|
||||
* Ensure that invalid JSON in the subplugins.json file warns appropriately.
|
||||
*
|
||||
* @dataProvider invalid_subplugins_json_provider
|
||||
* @param string[] $expectedwarnings Errors to expect in the exception message
|
||||
* @param array[] $json The contents of the subplugins.json file
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\DataProvider('invalid_subplugins_json_provider')]
|
||||
public function test_fetch_subtypes_json_invalid_values(
|
||||
array $expectedwarnings,
|
||||
array $json,
|
||||
@@ -1639,10 +1624,8 @@ final class component_test extends \advanced_testcase {
|
||||
|
||||
/**
|
||||
* Test various methods when a deprecated plugin type is introduced.
|
||||
*
|
||||
* @runInSeparateProcess
|
||||
* @return void
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
|
||||
public function test_core_component_deprecated_plugintype(): void {
|
||||
$this->resetAfterTest();
|
||||
|
||||
@@ -1704,8 +1687,10 @@ final class component_test extends \advanced_testcase {
|
||||
$this->assertEquals('fake_fullfeatured', component::get_component_from_classname(\fake_fullfeatured\example::class));
|
||||
|
||||
// Class autoloading of deprecated plugins is permitted, to facilitate plugin migration code.
|
||||
$this->assertArrayHasKey('fake_fullfeatured\dummy',
|
||||
component::get_component_classes_in_namespace('fake_fullfeatured'));
|
||||
$this->assertArrayHasKey(
|
||||
'fake_fullfeatured\dummy',
|
||||
component::get_component_classes_in_namespace('fake_fullfeatured')
|
||||
);
|
||||
$this->assertTrue(class_exists(\fake_fullfeatured\dummy::class));
|
||||
}
|
||||
|
||||
@@ -1752,17 +1737,17 @@ final class component_test extends \advanced_testcase {
|
||||
$this->assertNull(component::get_component_from_classname(\fake_fullfeatured\example::class));
|
||||
|
||||
// Class autoloading of deleted plugins is not supported.
|
||||
$this->assertArrayNotHasKey('fake_fullfeatured\dummy',
|
||||
component::get_component_classes_in_namespace('fake_fullfeatured'));
|
||||
$this->assertArrayNotHasKey(
|
||||
'fake_fullfeatured\dummy',
|
||||
component::get_component_classes_in_namespace('fake_fullfeatured')
|
||||
);
|
||||
$this->assertFalse(class_exists(fake_fullfeatured\dummy::class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test various core_component APIs when dealing with deprecated subplugins.
|
||||
*
|
||||
* @runInSeparateProcess
|
||||
* @return void
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
|
||||
public function test_core_component_deprecated_subplugintype(): void {
|
||||
$this->resetAfterTest();
|
||||
|
||||
@@ -1780,10 +1765,8 @@ final class component_test extends \advanced_testcase {
|
||||
|
||||
/**
|
||||
* Verify that a plugin which supports subplugins cannot be deprecated.
|
||||
*
|
||||
* @runInSeparateProcess
|
||||
* @return void
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
|
||||
public function test_core_component_deprecated_subplugintype_supporting_subplugins(): void {
|
||||
$this->resetAfterTest();
|
||||
|
||||
@@ -1809,10 +1792,8 @@ final class component_test extends \advanced_testcase {
|
||||
|
||||
/**
|
||||
* Verify that a plugin which supports subplugins cannot be deleted.
|
||||
*
|
||||
* @runInSeparateProcess
|
||||
* @return void
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
|
||||
public function test_core_component_deleted_subplugintype_supporting_subplugins(): void {
|
||||
$this->resetAfterTest();
|
||||
|
||||
@@ -1838,8 +1819,6 @@ final class component_test extends \advanced_testcase {
|
||||
|
||||
/**
|
||||
* Helper asserting the returns for various core_component APIs when dealing with deprecated and deleted subplugins.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function assert_deprecation_apis_subplugins(): void {
|
||||
// Deprecation-specific methods.
|
||||
@@ -1949,10 +1928,14 @@ final class component_test extends \advanced_testcase {
|
||||
$this->assertFalse(component::has_monologo_icon('fulldeletedsubtype', 'demo'));
|
||||
|
||||
$this->assertEquals('fake_fullfeatured', component::get_component_from_classname(\fake_fullfeatured\example::class));
|
||||
$this->assertEquals('fullsubtype_example',
|
||||
component::get_component_from_classname(\fullsubtype_example\example::class));
|
||||
$this->assertEquals('fulldeprecatedsubtype_test',
|
||||
component::get_component_from_classname(\fulldeprecatedsubtype_test\example::class));
|
||||
$this->assertEquals(
|
||||
'fullsubtype_example',
|
||||
component::get_component_from_classname(\fullsubtype_example\example::class)
|
||||
);
|
||||
$this->assertEquals(
|
||||
'fulldeprecatedsubtype_test',
|
||||
component::get_component_from_classname(\fulldeprecatedsubtype_test\example::class)
|
||||
);
|
||||
$this->assertNull(component::get_component_from_classname(\fulldeletedsubtype_demo\example::class));
|
||||
|
||||
// Deprecated and deleted plugins included in the following.
|
||||
@@ -1961,12 +1944,18 @@ final class component_test extends \advanced_testcase {
|
||||
$this->assertEquals('fake_fullfeatured', component::get_subtype_parent('fulldeletedsubtype'));
|
||||
|
||||
// Class autoloading of deprecated plugins is permitted, to facilitate plugin migration code, but not for deleted plugins.
|
||||
$this->assertArrayHasKey('fake_fullfeatured\dummy',
|
||||
component::get_component_classes_in_namespace('fake_fullfeatured'));
|
||||
$this->assertArrayHasKey('fullsubtype_example\dummy',
|
||||
component::get_component_classes_in_namespace('fullsubtype_example'));
|
||||
$this->assertArrayHasKey('fulldeprecatedsubtype_test\dummy',
|
||||
component::get_component_classes_in_namespace('fulldeprecatedsubtype_test'));
|
||||
$this->assertArrayHasKey(
|
||||
'fake_fullfeatured\dummy',
|
||||
component::get_component_classes_in_namespace('fake_fullfeatured')
|
||||
);
|
||||
$this->assertArrayHasKey(
|
||||
'fullsubtype_example\dummy',
|
||||
component::get_component_classes_in_namespace('fullsubtype_example')
|
||||
);
|
||||
$this->assertArrayHasKey(
|
||||
'fulldeprecatedsubtype_test\dummy',
|
||||
component::get_component_classes_in_namespace('fulldeprecatedsubtype_test')
|
||||
);
|
||||
$this->assertEquals([], component::get_component_classes_in_namespace('fulldeletedsubtype_demo'));
|
||||
|
||||
$this->assertTrue(class_exists(\fake_fullfeatured\dummy::class));
|
||||
|
||||
@@ -749,7 +749,7 @@ All rights reserved.</copyright>
|
||||
<location>symfony/deprecation-contracts</location>
|
||||
<name>Symfony Deprecation contracts</name>
|
||||
<description>A generic function and convention to trigger deprecation notices</description>
|
||||
<version>3.5.1</version>
|
||||
<version>3.6.0</version>
|
||||
<license>MIT</license>
|
||||
<repository>https://github.com/symfony/deprecation-contracts</repository>
|
||||
</library>
|
||||
@@ -764,7 +764,7 @@ All rights reserved.</copyright>
|
||||
<library>
|
||||
<location>webauthn</location>
|
||||
<name>WebAuthn</name>
|
||||
<version>2.2.2</version>
|
||||
<version>2.2.0</version>
|
||||
<license>MIT</license>
|
||||
<repository>https://github.com/lbuchs/WebAuthn</repository>
|
||||
</library>
|
||||
|
||||
@@ -29,15 +29,6 @@ use stdClass;
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class aws_sns implements aws_sms_service_provider {
|
||||
|
||||
/**
|
||||
* Include the required calls.
|
||||
*/
|
||||
private static function require(): void {
|
||||
global $CFG;
|
||||
require_once($CFG->libdir . '/aws-sdk/src/functions.php');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public static function send_sms_message(
|
||||
string $messagecontent,
|
||||
@@ -45,7 +36,6 @@ class aws_sns implements aws_sms_service_provider {
|
||||
stdclass $config,
|
||||
): message_status {
|
||||
global $SITE;
|
||||
self::require();
|
||||
|
||||
// Setup client params and instantiate client.
|
||||
$params = [
|
||||
|
||||
Reference in New Issue
Block a user