diff --git a/activeprocesses.php b/activeprocesses.php index 00a6f0ec4ee70cd3b451a57922d0ec75c5732d2e..7efdd38d6464aa05a376527fa9baaed0b6c3f7ff 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 98cd86127b110a15aec73261275454b2209f02f3..aa151b81e4636c2cec6dacfd405224d623e1fbb0 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 451f58b11b811883ea197c86ffd529efccc4c55e..3b019c7dea43e96e8c6f71979c9fd11b131dff8c 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 68c714b9beb511728001126c3c5fa25f1689404e..e325eefbb4dcb12ad65b8c3c87d41955e829723d 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 2dcca8efd8a0c8bbb251f7039ebc3b7fa6288250..de3ac303368ee35ef73bed71138f8395ec988343 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 96a4ec728ee0ca4da3d50233b00144c00ba70993..ad29b353a5bb07cbc4d27591852f7f0d2ec78559 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 49572cddcc4ec320f20b047849b772ca4ebae1c4..9d0bb75e7299fc18dbe5f3289044a45c0aaa734b 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 de502e5f63a756ba47ceeb5b36e83da980b3b633..2e004264a02cfe5ce33468d2eb9d15b7f639b557 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 03ffeff11da0f1db94635578af0604c8d2f36ad6..e43eb80b1d49ca260723acc0c25da8439e7f383e 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 82c702d1a3e6eeb3cabb5cbf0d1391388218557d..2472092b2a68fd7cbb973922b16c60918cc35bde 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 8934b0e4610e077cb0368e805ce7d3fd259de0fa..2ed7603274796cda590315a530336965d7fb9988 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 f6c36d0cfbfdd223e766ac06fd1a553cacaff190..db905e01f8e94b58f7349c554f86b1583c4f8a78 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 e0ee7e81c1fba7fd99cedfbe2b1ed34741caf676..52597adc0145ab6965695b8561683abf991923d1 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 462d2d913029727b7e9cbf59b304fe12d1b282c6..b76f67be65f0f81e0aeedbfe988f9e486daa94e9 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 cf985dd0066baeca3cb3515adb84d67dac7c18e0..2915ab552a2ba6c3673851f7351561320665dced 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 e87f466eaf2da5009af4718c337ad7e55a97840f..bc830a0a83ad672956fc520d57cb101adb7400d9 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 a68aae36de1e845c2312a90c3f83eb704714b307..9fc648975e3d3a8240328578b59efe9a5c7c7b28 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 dc047519c396c758c9984ba48ce2da2c84e57eee..461a5f37cf9b9d0b9f466915e31d887a9a05b8fe 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 5626b899dd68dfc3818dc5d6353a7b173207fd90..5a825a62cc5a315b1344560bd7caccef6f9710fc 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 b3b4c264d3eddc148b6772987b69edbb68f8f53e..dad40e119dfdc77fe66406d76e67b6d1dc2ebe16 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 d418e3a6f5587be9aa5a3d4044f72e4306d66dfa..e91623cbfcce14a2a37215269455d825ff3b04de 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 6aac9fad4958c1ba24d2f287240ce21964bf44fb..e48b37c0dfcb9536cba672576538ad51867e3c19 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 077149e435340a2ff127c58ff7853154255f9ddd..c00bfda60f538d18347eb0d56a3c6bc79bec89b4 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 89dd51d333de703c52b93909ac5ee19dc6c609c0..ed8dedf0b8e22733d442a989464895b2d335eb3f 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 655ccfa77261dd84b77f57cfbc47a55e399d67dc..2f48f48b53d778d6d806abfe43c4966e059420b8 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 6ca598fd0c48cea2baf916ff65ddea74502a1873..0175bf4ea68c78c5ecceb01f4ab192fcc1a85d5e 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 2945d75388fa8f667102fcce25fcbe9676e83a9e..7fd08dfb57bf98c860634621d9a3c4d3218f3b60 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 64f057849bcda5ab2157e19d91f9e7b3f953261d..f220ecaa929f4dd05b05efbe7ed35038ff999e51 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 9f6a49e376da3c3c37b31a286bb10637d2805809..c4229929200c4f48887921294c3e55037d8064a1 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;