From 1ae17069f334802c571aa105427e6541c7587b5e Mon Sep 17 00:00:00 2001
From: n_herr03 <nina.herrmann@uni-muenster.de>
Date: Wed, 19 Oct 2022 13:16:47 +0200
Subject: [PATCH] Codechecker, yay
---
activeprocesses.php | 2 +-
activeworkflows.php | 1 +
createworkflowfromexisting.php | 1 +
deactivatedworkflows.php | 1 +
editelement.php | 3 +-
editworkflow.php | 1 +
lang/en/tool_lifecycle.php | 2 +-
tests/active_workflow_is_manual_test.php | 12 ++++-
.../active_workflow_sortindex_updown_test.php | 8 ++-
tests/backup_and_restore_workflow_test.php | 1 +
tests/backup_manager_test.php | 2 +
tests/manual_trigger_tools_test.php | 2 +
tests/manually_triggered_process_test.php | 1 +
.../persistence/persist_process_data_test.php | 4 +-
tests/persistence/persist_process_test.php | 7 ++-
tests/persistence/persist_step_test.php | 7 ++-
tests/persistence/persist_workflow_test.php | 4 +-
tests/privacy_test.php | 50 ++++++++++++++++++-
tests/process_error_test.php | 1 +
tests/process_status_message_test.php | 1 +
tests/settings_manager_test.php | 3 ++
...rkflow_activate_disable_duplicate_test.php | 5 ++
trigger/categories/tests/trigger_test.php | 3 ++
trigger/delayedcourses/tests/trigger_test.php | 5 ++
trigger/sitecourse/tests/trigger_test.php | 2 +
trigger/startdatedelay/tests/trigger_test.php | 2 +
uploadworkflow.php | 2 +-
workflowdrafts.php | 1 +
workflowoverview.php | 1 +
29 files changed, 124 insertions(+), 11 deletions(-)
diff --git a/activeprocesses.php b/activeprocesses.php
index 00a6f0e..7efdd38 100644
--- a/activeprocesses.php
+++ b/activeprocesses.php
@@ -23,7 +23,7 @@
*/
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
-
+require_login();
\tool_lifecycle\permission_and_navigation::setup_active();
$PAGE->set_url(new \moodle_url(\tool_lifecycle\urls::ACTIVE_PROCESSES));
diff --git a/activeworkflows.php b/activeworkflows.php
index 98cd861..aa151b8 100644
--- a/activeworkflows.php
+++ b/activeworkflows.php
@@ -28,6 +28,7 @@ use tool_lifecycle\urls;
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
+require_login();
global $OUTPUT, $PAGE, $DB;
diff --git a/createworkflowfromexisting.php b/createworkflowfromexisting.php
index 451f58b..3b019c7 100644
--- a/createworkflowfromexisting.php
+++ b/createworkflowfromexisting.php
@@ -31,6 +31,7 @@ use tool_lifecycle\urls;
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
+require_login();
global $OUTPUT, $PAGE, $DB;
diff --git a/deactivatedworkflows.php b/deactivatedworkflows.php
index 68c714b..e325eef 100644
--- a/deactivatedworkflows.php
+++ b/deactivatedworkflows.php
@@ -24,6 +24,7 @@
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
+require_login();
use tool_lifecycle\local\table\deactivated_workflows_table;
use tool_lifecycle\urls;
diff --git a/editelement.php b/editelement.php
index 2dcca8e..de3ac30 100644
--- a/editelement.php
+++ b/editelement.php
@@ -35,6 +35,7 @@ use tool_lifecycle\urls;
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
+require_login();
global $OUTPUT, $PAGE, $DB;
@@ -96,7 +97,7 @@ if ($isstep) {
$titlestrid = ($element ? 'edit' : 'create') . '_' . $type;
$title = get_string($titlestrid, 'tool_lifecycle');
-// Return to drafts, or to deactivated workflows if workflow was deactivated
+// Return to drafts, or to deactivated workflows if workflow was deactivated.
$returnurl = new moodle_url(urls::WORKFLOW_DETAILS, ['wf' => $workflow->id]);
$PAGE->set_title($title);
diff --git a/editworkflow.php b/editworkflow.php
index 96a4ec7..ad29b35 100644
--- a/editworkflow.php
+++ b/editworkflow.php
@@ -31,6 +31,7 @@ use tool_lifecycle\urls;
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
+require_login();
global $OUTPUT, $PAGE, $DB;
diff --git a/lang/en/tool_lifecycle.php b/lang/en/tool_lifecycle.php
index 49572cd..9d0bb75 100644
--- a/lang/en/tool_lifecycle.php
+++ b/lang/en/tool_lifecycle.php
@@ -258,7 +258,7 @@ Still, these numbers are only approximates, since it could be that a course is e
$string['overview:add_trigger'] = 'Add trigger';
$string['overview:add_trigger_help'] = 'You can only add one instance of each trigger type.';
-// Create copy from existing workflow
+// Create copy from existing workflow.
$string['create_copy'] = 'Create copy';
$string['active'] = 'Active';
$string['deactivated'] = 'Deactivated';
diff --git a/tests/active_workflow_is_manual_test.php b/tests/active_workflow_is_manual_test.php
index de502e5..2e00426 100644
--- a/tests/active_workflow_is_manual_test.php
+++ b/tests/active_workflow_is_manual_test.php
@@ -40,7 +40,7 @@ use tool_lifecycle\local\entity\workflow;
* @copyright 2018 WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class workflow_is_manual_test extends \advanced_testcase {
+class active_workflow_is_manual_test extends \advanced_testcase {
/** Icon of the trigger. */
const MANUAL_TRIGGER1_ICON = 't/up';
@@ -79,6 +79,11 @@ class workflow_is_manual_test extends \advanced_testcase {
/**
* Test to activate the manual workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager manual workflows
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \dml_transaction_exception
+ * @throws \moodle_exception
*/
public function test_activate_manual() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->manualworkflow->id);
@@ -89,6 +94,11 @@ class workflow_is_manual_test extends \advanced_testcase {
/**
* Test to activate the automatic workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager active workflows
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \dml_transaction_exception
+ * @throws \moodle_exception
*/
public function test_activate_automatic() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->automaticworkflow->id);
diff --git a/tests/active_workflow_sortindex_updown_test.php b/tests/active_workflow_sortindex_updown_test.php
index 03ffeff..e43eb80 100644
--- a/tests/active_workflow_sortindex_updown_test.php
+++ b/tests/active_workflow_sortindex_updown_test.php
@@ -41,10 +41,11 @@ use tool_lifecycle\local\manager\workflow_manager;
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class workflow_sortindex_updown_test extends workflow_actions_testcase {
+class active_workflow_sortindex_updown_test extends workflow_actions_testcase {
/**
* Test to put down the first workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager move actions down
*/
public function test_down_first() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -64,6 +65,7 @@ class workflow_sortindex_updown_test extends workflow_actions_testcase {
/**
* Test to put down the second workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager move actions down
*/
public function test_down_second() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -83,6 +85,7 @@ class workflow_sortindex_updown_test extends workflow_actions_testcase {
/**
* Test to put down the third workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager move actions down
*/
public function test_down_third() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -102,6 +105,7 @@ class workflow_sortindex_updown_test extends workflow_actions_testcase {
/**
* Test to put up the third workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager move actions up
*/
public function test_up_first() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -121,6 +125,7 @@ class workflow_sortindex_updown_test extends workflow_actions_testcase {
/**
* Test to put up the third workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager move actions up
*/
public function test_up_second() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -140,6 +145,7 @@ class workflow_sortindex_updown_test extends workflow_actions_testcase {
/**
* Test to put up the third workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager move actions up
*/
public function test_up_third() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
diff --git a/tests/backup_and_restore_workflow_test.php b/tests/backup_and_restore_workflow_test.php
index 82c702d..2472092 100644
--- a/tests/backup_and_restore_workflow_test.php
+++ b/tests/backup_and_restore_workflow_test.php
@@ -67,6 +67,7 @@ class backup_and_restore_workflow_test extends \advanced_testcase {
/**
* Test to activate the manual workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager check if backup is created
*/
public function test_backup_workflow() {
$backuptask = new backup_lifecycle_workflow($this->workflow->id);
diff --git a/tests/backup_manager_test.php b/tests/backup_manager_test.php
index 8934b0e..2ed7603 100644
--- a/tests/backup_manager_test.php
+++ b/tests/backup_manager_test.php
@@ -49,6 +49,7 @@ class backup_manager_test extends \advanced_testcase {
/**
* Test creating a backup for a course.
+ * @covers \tool_lifecycle\local\manager\backup_manager create backup
*/
public function test_backup_create() {
global $DB;
@@ -60,6 +61,7 @@ class backup_manager_test extends \advanced_testcase {
/**
* Test redirect without errors when starting to restore a backup.
+ * @covers \tool_lifecycle\local\manager\backup_manager restore backup
*/
public function test_backup_restore() {
global $DB;
diff --git a/tests/manual_trigger_tools_test.php b/tests/manual_trigger_tools_test.php
index f6c36d0..db905e0 100644
--- a/tests/manual_trigger_tools_test.php
+++ b/tests/manual_trigger_tools_test.php
@@ -85,6 +85,7 @@ class manual_trigger_tools_test extends \advanced_testcase {
/**
* Test getting manual trigger tools of active workflows.
+ * @covers \tool_lifecycle\local\manager\workflow_manager get triggers for one wf
*/
public function test_get_manual_trigger_tools_for_one_active_workflow() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
@@ -99,6 +100,7 @@ class manual_trigger_tools_test extends \advanced_testcase {
/**
* Test getting manual trigger tools of active workflows.
+ * @covers \tool_lifecycle\local\manager\workflow_manager get triggers for multiple wf
*/
public function test_get_manual_trigger_tools_for_active_workflows() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
diff --git a/tests/manually_triggered_process_test.php b/tests/manually_triggered_process_test.php
index e0ee7e8..52597ad 100644
--- a/tests/manually_triggered_process_test.php
+++ b/tests/manually_triggered_process_test.php
@@ -93,6 +93,7 @@ class manually_triggered_process_test extends \advanced_testcase {
/**
* Test to proceed a manually triggered process to step index 1.
+ * @covers \tool_lifecycle\local\manager\process_manager test if manual process started
*/
public function test_proceeding_of_manually_triggered_processes() {
$process = process_manager::manually_trigger_process($this->course->id, $this->trigger->id);
diff --git a/tests/persistence/persist_process_data_test.php b/tests/persistence/persist_process_data_test.php
index 462d2d9..b76f67b 100644
--- a/tests/persistence/persist_process_data_test.php
+++ b/tests/persistence/persist_process_data_test.php
@@ -22,6 +22,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+namespace tool_lifecycle;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../../lib.php');
@@ -39,7 +40,7 @@ use tool_lifecycle\local\manager\step_manager;
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class tool_lifecycle_persist_process_data_testcase extends \advanced_testcase {
+class persist_process_data_test extends \advanced_testcase {
/** @var process $process Instance of the process. */
private $process;
@@ -67,6 +68,7 @@ class tool_lifecycle_persist_process_data_testcase extends \advanced_testcase {
/**
* Test the getting and setting of process data.
+ * @covers \tool_lifecycle\local\manager\process_data_manager
*/
public function test_get_set_process_data() {
$step = step_manager::get_step_instance_by_workflow_index($this->process->workflowid, $this->process->stepindex);
diff --git a/tests/persistence/persist_process_test.php b/tests/persistence/persist_process_test.php
index cf985dd..2915ab5 100644
--- a/tests/persistence/persist_process_test.php
+++ b/tests/persistence/persist_process_test.php
@@ -22,6 +22,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+namespace tool_lifecycle;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../../lib.php');
@@ -38,7 +39,7 @@ use tool_lifecycle\local\manager\process_manager;
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class tool_lifecycle_persist_process_testcase extends \advanced_testcase {
+class persist_process_test extends \advanced_testcase {
/** @var workflow $workflow Instance of the workflow. */
private $workflow;
@@ -60,6 +61,7 @@ class tool_lifecycle_persist_process_testcase extends \advanced_testcase {
/**
* Test the creation of a process.
+ * @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_create() {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
@@ -73,6 +75,7 @@ class tool_lifecycle_persist_process_testcase extends \advanced_testcase {
/**
* Tests setting a process on waiting.
+ * @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_waiting() {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
@@ -84,6 +87,7 @@ class tool_lifecycle_persist_process_testcase extends \advanced_testcase {
/**
* Tests deletion of a process when rolledback.
+ * @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_rollback() {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
@@ -95,6 +99,7 @@ class tool_lifecycle_persist_process_testcase extends \advanced_testcase {
/**
* Tests proceeding a process to the next step.
+ * @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_proceed() {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
diff --git a/tests/persistence/persist_step_test.php b/tests/persistence/persist_step_test.php
index e87f466..bc830a0 100644
--- a/tests/persistence/persist_step_test.php
+++ b/tests/persistence/persist_step_test.php
@@ -22,6 +22,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+namespace tool_lifecycle;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../../lib.php');
@@ -38,7 +39,7 @@ use tool_lifecycle\local\manager\step_manager;
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class tool_lifecycle_persist_step_testcase extends \advanced_testcase {
+class persist_step_test extends \advanced_testcase {
/** @var workflow $workflow Instance of the workflow. */
private $workflow;
@@ -60,6 +61,7 @@ class tool_lifecycle_persist_step_testcase extends \advanced_testcase {
/**
* Test that after an insert the id from the database is set within the step object.
+ * @covers \tool_lifecycle\local\manager\step_manager
*/
public function test_add_step() {
$step = $this->generator->create_step(
@@ -73,6 +75,7 @@ class tool_lifecycle_persist_step_testcase extends \advanced_testcase {
/**
* Test that sortindizes are created correclty when creating multiple steps.
+ * @covers \tool_lifecycle\local\manager\step_manager
*/
public function test_add_multiple_steps() {
$step1 = $this->generator->create_step(
@@ -94,6 +97,7 @@ class tool_lifecycle_persist_step_testcase extends \advanced_testcase {
/**
* Test that the step can be removed correctly.
+ * @covers \tool_lifecycle\local\manager\step_manager
*/
public function test_remove_step() {
$step1 = $this->generator->create_step(
@@ -126,6 +130,7 @@ class tool_lifecycle_persist_step_testcase extends \advanced_testcase {
/**
* Test that sortindizes are still created correctly, when some steps were already removed.
+ * @covers \tool_lifecycle\local\manager\step_manager
*/
public function test_add_after_remove_step() {
$step1 = $this->generator->create_step(
diff --git a/tests/persistence/persist_workflow_test.php b/tests/persistence/persist_workflow_test.php
index a68aae3..9fc6489 100644
--- a/tests/persistence/persist_workflow_test.php
+++ b/tests/persistence/persist_workflow_test.php
@@ -22,6 +22,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+namespace tool_lifecycle;
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../../lib.php');
@@ -37,7 +38,7 @@ use tool_lifecycle\local\manager\workflow_manager;
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class tool_lifecycle_persist_workflow_testcase extends \advanced_testcase {
+class persist_workflow_test extends \advanced_testcase {
/** @var workflow $workflow Instance of the workflow. */
private $workflow;
@@ -55,6 +56,7 @@ class tool_lifecycle_persist_workflow_testcase extends \advanced_testcase {
/**
* Test the creation of a process.
+ * @covers \tool_lifecycle\local\manager\workflow_manager create a wf.
*/
public function test_create() {
$this->assertNull($this->workflow->id);
diff --git a/tests/privacy_test.php b/tests/privacy_test.php
index dc04751..461a5f3 100644
--- a/tests/privacy_test.php
+++ b/tests/privacy_test.php
@@ -22,7 +22,7 @@
* @copyright 2019 Justus Dieckmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-namespace tool_lifecycle\privacy;
+namespace tool_lifecycle;
defined('MOODLE_INTERNAL') || die();
global $CFG;
@@ -92,6 +92,14 @@ class privacy_test extends provider_testcase {
$this->emailstep = $this->generator->create_step("instance2", "email", $this->workflow->id);
}
+ /**
+ * Get all contextes in which users are effected.
+ * @covers \tool_lifecycle\privacy\provider contexts
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \invalid_parameter_exception
+ * @throws \moodle_exception
+ */
public function test_get_contexts_for_userid() {
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
@@ -114,6 +122,14 @@ class privacy_test extends provider_testcase {
$this->assertTrue($contextlist->current() instanceof \context_system);
}
+ /**
+ * Export all data for privacy provider
+ * @covers \tool_lifecycle\privacy\provider data
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \invalid_parameter_exception
+ * @throws \moodle_exception
+ */
public function test_export_user_data() {
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
@@ -145,6 +161,14 @@ class privacy_test extends provider_testcase {
$this->assertEquals(self::ACTION_KEEP, $data2->action);
}
+ /**
+ * delete data for context - privacy provider
+ * @covers \tool_lifecycle\privacy\provider data
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \invalid_parameter_exception
+ * @throws \moodle_exception
+ */
public function test_delete_data_for_all_users_in_context() {
global $DB;
$c1 = $this->getDataGenerator()->create_course();
@@ -163,6 +187,14 @@ class privacy_test extends provider_testcase {
$this->assertFalse($DB->record_exists_select('tool_lifecycle_action_log', 'userid != -1'));
}
+ /**
+ * delete data for user - privacy provider
+ * @covers \tool_lifecycle\privacy\provider data
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \invalid_parameter_exception
+ * @throws \moodle_exception
+ */
public function test_delete_data_for_user() {
global $DB;
$c1 = $this->getDataGenerator()->create_course();
@@ -189,6 +221,14 @@ class privacy_test extends provider_testcase {
$this->assertEquals(1, $DB->count_records_select('tool_lifecycle_action_log', "userid = -1"));
}
+ /**
+ * all users of context - privacy provider
+ * @covers \tool_lifecycle\privacy\provider user in context
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \invalid_parameter_exception
+ * @throws \moodle_exception
+ */
public function test_get_users_in_context() {
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
@@ -210,6 +250,14 @@ class privacy_test extends provider_testcase {
$this->assertEquals($u1->id, $userlist->current()->id);
}
+ /**
+ * delete data for *users* - privacy provider
+ * @covers \tool_lifecycle\privacy\provider data *users*
+ * @throws \coding_exception
+ * @throws \dml_exception
+ * @throws \invalid_parameter_exception
+ * @throws \moodle_exception
+ */
public function test_delete_data_for_users() {
global $DB;
$c1 = $this->getDataGenerator()->create_course();
diff --git a/tests/process_error_test.php b/tests/process_error_test.php
index 5626b89..5a825a6 100644
--- a/tests/process_error_test.php
+++ b/tests/process_error_test.php
@@ -90,6 +90,7 @@ class process_error_test extends \advanced_testcase {
/**
* Test if the correct process error was put into the table.
+ * @covers \tool_lifecycle\processor
*/
public function test_process_error_in_table() {
global $DB;
diff --git a/tests/process_status_message_test.php b/tests/process_status_message_test.php
index b3b4c26..dad40e1 100644
--- a/tests/process_status_message_test.php
+++ b/tests/process_status_message_test.php
@@ -74,6 +74,7 @@ class process_status_message_test extends \advanced_testcase {
/**
* Test getting status message for a process.
+ * @covers \tool_lifecycle\local\manager\interaction_manager
*/
public function test_get_status_message() {
$process = $this->generator->create_process(2, $this->workflow->id);
diff --git a/tests/settings_manager_test.php b/tests/settings_manager_test.php
index d418e3a..e91623c 100644
--- a/tests/settings_manager_test.php
+++ b/tests/settings_manager_test.php
@@ -69,6 +69,7 @@ class settings_manager_test extends \advanced_testcase {
/**
* Test setting and getting settings data for steps.
+ * @covers \tool_lifecycle\local\manager\settings_manager
*/
public function test_set_get_step_settings() {
$data = new \stdClass();
@@ -81,6 +82,7 @@ class settings_manager_test extends \advanced_testcase {
/**
* Test setting and getting settings data for triggers.
+ * @covers \tool_lifecycle\local\manager\settings_manager
*/
public function test_set_get_trigger_settings() {
$data = new \stdClass();
@@ -93,6 +95,7 @@ class settings_manager_test extends \advanced_testcase {
/**
* Test correct removal of setting, if steps, triggers or workflows are deleted.
+ * @covers \tool_lifecycle\local\manager\settings_manager
*/
public function test_remove_workflow() {
global $DB;
diff --git a/tests/workflow_activate_disable_duplicate_test.php b/tests/workflow_activate_disable_duplicate_test.php
index 6aac9fa..e48b37c 100644
--- a/tests/workflow_activate_disable_duplicate_test.php
+++ b/tests/workflow_activate_disable_duplicate_test.php
@@ -46,6 +46,7 @@ class workflow_activate_disable_duplicate_test extends workflow_actions_testcase
/**
* Test to activate the first workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager
*/
public function test_activate_first() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -56,6 +57,7 @@ class workflow_activate_disable_duplicate_test extends workflow_actions_testcase
/**
* Test to activate the first and the second workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager
*/
public function test_activate_second() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -68,6 +70,7 @@ class workflow_activate_disable_duplicate_test extends workflow_actions_testcase
/**
* Test to activate all three workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager
*/
public function test_activate_third() {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
@@ -81,6 +84,7 @@ class workflow_activate_disable_duplicate_test extends workflow_actions_testcase
/**
* Test to deactivate the first workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager
*/
public function test_deactivate_first() {
workflow_manager::handle_action(action::WORKFLOW_ABORTDISABLE, $this->workflow1->id);
@@ -89,6 +93,7 @@ class workflow_activate_disable_duplicate_test extends workflow_actions_testcase
/**
* Test to duplicate the first workflow.
+ * @covers \tool_lifecycle\local\manager\workflow_manager
*/
public function test_duplicate_first() {
workflow_manager::handle_action(action::WORKFLOW_DUPLICATE, $this->workflow1->id);
diff --git a/trigger/categories/tests/trigger_test.php b/trigger/categories/tests/trigger_test.php
index 077149e..c00bfda 100644
--- a/trigger/categories/tests/trigger_test.php
+++ b/trigger/categories/tests/trigger_test.php
@@ -84,6 +84,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests if courses, which are in the category are correctly triggered.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\categories
*/
public function test_course_has_cat() {
@@ -108,6 +109,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests if courses, which are in the category are correctly triggered.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\categories
*/
public function test_course_within_cat() {
@@ -132,6 +134,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests if courses, which are not in the category are correctly triggered.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\categories
*/
public function test_course_not_within_cat() {
$course = $this->getDataGenerator()->create_course();
diff --git a/trigger/delayedcourses/tests/trigger_test.php b/trigger/delayedcourses/tests/trigger_test.php
index 89dd51d..ed8dedf 100644
--- a/trigger/delayedcourses/tests/trigger_test.php
+++ b/trigger/delayedcourses/tests/trigger_test.php
@@ -69,6 +69,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests that a course is not excluded by this plugin, when there exists no dalayed entry, yet.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\delayedcourses
*/
public function test_course_not_delayed() {
@@ -87,6 +88,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests that a course is excluded by this plugin, when there exists a dalayed entry.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\delayedcourses
*/
public function test_course_delayed() {
@@ -107,6 +109,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests that a course is not excluded by this plugin, when there exists a dalayed entry, but it is expired.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\delayedcourses
*/
public function test_course_delay_expired() {
$course = $this->getDataGenerator()->create_course();
@@ -124,6 +127,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests that a course is not excluded by this plugin, when it was delayed for a single workflow.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\delayedcourses
*/
public function test_course_delay_for_single_workflow() {
$course = $this->getDataGenerator()->create_course();
@@ -141,6 +145,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests that a course is excluded by this plugin, when it was delayed for all workflows.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\delayedcourses
*/
public function test_course_delay_for_all_workflows() {
$course = $this->getDataGenerator()->create_course();
diff --git a/trigger/sitecourse/tests/trigger_test.php b/trigger/sitecourse/tests/trigger_test.php
index 655ccfa..2f48f48 100644
--- a/trigger/sitecourse/tests/trigger_test.php
+++ b/trigger/sitecourse/tests/trigger_test.php
@@ -59,6 +59,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests if the site course is excluded by this plugin.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\sitecourse
*/
public function test_sitecourse_course() {
@@ -72,6 +73,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests if courses, which are older than the default of 190 days are triggered by this plugin.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\sitecourse
*/
public function test_normal_course() {
diff --git a/trigger/startdatedelay/tests/trigger_test.php b/trigger/startdatedelay/tests/trigger_test.php
index 6ca598f..0175bf4 100644
--- a/trigger/startdatedelay/tests/trigger_test.php
+++ b/trigger/startdatedelay/tests/trigger_test.php
@@ -58,6 +58,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests if courses, which are newer than the default of 190 days are not triggered by this plugin.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\startdatedelay
*/
public function test_young_course() {
@@ -76,6 +77,7 @@ class trigger_test extends \advanced_testcase {
/**
* Tests if courses, which are older than the default of 190 days are triggered by this plugin.
+ * @covers \tool_lifecycle\processor \tool_lifecycle\trigger\startdatedelay
*/
public function test_old_course() {
diff --git a/uploadworkflow.php b/uploadworkflow.php
index 2945d75..7fd08df 100644
--- a/uploadworkflow.php
+++ b/uploadworkflow.php
@@ -33,7 +33,7 @@ use tool_lifecycle\urls;
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
-
+require_login();
global $OUTPUT, $PAGE, $DB;
\tool_lifecycle\permission_and_navigation::setup_draft();
diff --git a/workflowdrafts.php b/workflowdrafts.php
index 64f0578..f220eca 100644
--- a/workflowdrafts.php
+++ b/workflowdrafts.php
@@ -28,6 +28,7 @@ use tool_lifecycle\urls;
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
+require_login();
global $OUTPUT, $PAGE, $DB;
diff --git a/workflowoverview.php b/workflowoverview.php
index 9f6a49e..c422992 100644
--- a/workflowoverview.php
+++ b/workflowoverview.php
@@ -23,6 +23,7 @@
*/
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
+require_login();
use tool_lifecycle\action;
use tool_lifecycle\local\manager\delayed_courses_manager;
--
GitLab