From 178b6617f5979b18dd64de7af06fe4fc587713ff Mon Sep 17 00:00:00 2001 From: Justus Dieckmann Date: Wed, 21 Feb 2024 12:26:16 +0100 Subject: [PATCH] Use existing category in backup_and_restore test --- tests/backup_and_restore_workflow_test.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/backup_and_restore_workflow_test.php b/tests/backup_and_restore_workflow_test.php index 2472092b..97e3a6b9 100644 --- a/tests/backup_and_restore_workflow_test.php +++ b/tests/backup_and_restore_workflow_test.php @@ -28,6 +28,7 @@ require_once(__DIR__ . '/generator/lib.php'); require_once(__DIR__ . '/../lib.php'); +use mod_bigbluebuttonbn\settings; use tool_lifecycle\local\backup\backup_lifecycle_workflow; use tool_lifecycle\local\backup\restore_lifecycle_workflow; use tool_lifecycle\local\manager\workflow_manager; @@ -60,6 +61,14 @@ public function setUp() : void { $this->resetAfterTest(true); $generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle'); $this->workflow = $generator->create_workflow(['startdatedelay', 'categories'], ['email', 'createbackup', 'deletecourse']); + $category = $this->getDataGenerator()->create_category(); + foreach (trigger_manager::get_triggers_for_workflow($this->workflow->id) as $trigger) { + if ($trigger->subpluginname === 'categories') { + settings_manager::save_setting($trigger->id, settings_type::TRIGGER, 'categories', + 'categories', $category->id); + } + } + foreach (workflow_manager::get_workflows() as $existingworkflow) { $this->existingworkflows[] = $existingworkflow->id; }