Skip to content

Commit

Permalink
Use existing category in backup_and_restore test
Browse files Browse the repository at this point in the history
  • Loading branch information
justusdieckmann committed Feb 21, 2024
1 parent 62d75bb commit 178b661
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/backup_and_restore_workflow_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 178b661

Please sign in to comment.