Merge branch 'MDL-84394' of https://github.com/paulholden/moodle
This commit is contained in:
@@ -380,7 +380,7 @@ class manager {
|
||||
$provider = new $classname(
|
||||
enabled: $enabled,
|
||||
name: $name,
|
||||
config: $config ? json_encode($config) : '',
|
||||
config: json_encode($config ?? []),
|
||||
);
|
||||
|
||||
$id = $this->db->insert_record('ai_providers', $provider->to_record());
|
||||
|
||||
@@ -41,11 +41,9 @@ final class provider_test extends \advanced_testcase {
|
||||
|
||||
// Create the provider instance.
|
||||
$this->manager = \core\di::get(\core_ai\manager::class);
|
||||
$config = ['data' => 'goeshere'];
|
||||
$this->provider = $this->manager->create_provider_instance(
|
||||
classname: '\aiprovider_openai\provider',
|
||||
name: 'dummy',
|
||||
config: $config,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user