Skip to content
Snippets Groups Projects
Commit f2181c4b authored by Justus Dieckmann's avatar Justus Dieckmann
Browse files

Codestyle PHPCBF

parent 0099ef66
No related branches found
No related tags found
No related merge requests found
Showing
with 71 additions and 71 deletions
......@@ -31,6 +31,6 @@ $definitions = [
'application' => [
'mode' => cache_store::MODE_APPLICATION,
'simplekeys' => true,
'simpledata' => true
]
'simpledata' => true,
],
];
......@@ -44,7 +44,7 @@ use tool_lifecycle\local\manager\workflow_manager;
* @author Philipp Memmel
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider_test extends provider_testcase {
final class provider_test extends provider_testcase {
/**
* Basic setup for the provider tests.
......@@ -190,7 +190,7 @@ class provider_test extends provider_testcase {
* @return void
* @throws dml_exception
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
global $DB;
$approveduserlist = new approved_userlist(context_system::instance(), 'lifecyclestep_email',
[$this->user1->id, $this->user2->id]);
......@@ -212,7 +212,7 @@ class provider_test extends provider_testcase {
* @return void
* @throws dml_exception
*/
public function test_delete_data_for_users_coursecontext() {
public function test_delete_data_for_users_coursecontext(): void {
global $DB;
$approveduserlist = new approved_userlist(context_course::instance($this->course1->id), 'lifecyclestep_email',
[$this->user1->id, $this->user2->id]);
......
......@@ -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 active_workflow_is_manual_test extends \advanced_testcase {
final class active_workflow_is_manual_test extends \advanced_testcase {
/** Icon of the trigger. */
const MANUAL_TRIGGER1_ICON = 't/up';
......@@ -85,7 +85,7 @@ class active_workflow_is_manual_test extends \advanced_testcase {
* @throws \dml_transaction_exception
* @throws \moodle_exception
*/
public function test_activate_manual() {
public function test_activate_manual(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->manualworkflow->id);
$reloadworkflow = workflow_manager::get_workflow($this->manualworkflow->id);
$this->assertTrue(workflow_manager::is_active($this->manualworkflow->id));
......@@ -100,7 +100,7 @@ class active_workflow_is_manual_test extends \advanced_testcase {
* @throws \dml_transaction_exception
* @throws \moodle_exception
*/
public function test_activate_automatic() {
public function test_activate_automatic(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->automaticworkflow->id);
$reloadworkflow = workflow_manager::get_workflow($this->automaticworkflow->id);
$this->assertTrue(workflow_manager::is_active($this->automaticworkflow->id));
......
......@@ -41,13 +41,13 @@ 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 active_workflow_sortindex_updown_test extends workflow_actions_testcase {
final 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() {
public function test_down_first(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
......@@ -67,7 +67,7 @@ class active_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() {
public function test_down_second(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
......@@ -87,7 +87,7 @@ class active_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() {
public function test_down_third(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
......@@ -107,7 +107,7 @@ class active_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() {
public function test_up_first(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
......@@ -127,7 +127,7 @@ class active_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() {
public function test_up_second(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
......@@ -147,7 +147,7 @@ class active_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() {
public function test_up_third(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
......
......@@ -45,7 +45,7 @@ use tool_lifecycle\local\entity\workflow;
* @copyright 2018 WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_and_restore_workflow_test extends \advanced_testcase {
final class backup_and_restore_workflow_test extends \advanced_testcase {
/** @var $workflow workflow */
private $workflow;
......@@ -78,7 +78,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() {
public function test_backup_workflow(): void {
$backuptask = new backup_lifecycle_workflow($this->workflow->id);
$backuptask->execute();
$filename = $backuptask->get_temp_filename();
......
......@@ -34,7 +34,7 @@ use tool_lifecycle\local\manager\backup_manager;
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_manager_test extends \advanced_testcase {
final class backup_manager_test extends \advanced_testcase {
/** @var array $course Instance of the course under test. */
private $course;
......@@ -51,7 +51,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() {
public function test_backup_create(): void {
global $DB;
$result = backup_manager::create_course_backup($this->course->id);
$this->assertTrue($result);
......@@ -63,7 +63,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() {
public function test_backup_restore(): void {
global $DB;
$backups = $DB->get_records('tool_lifecycle_backups');
$this->assertEquals(1, count($backups));
......
......@@ -38,7 +38,7 @@ use tool_lifecycle\local\data\manual_trigger_tool;
* @copyright 2018 Tobias Reischmann, Jan Dageforde WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class manual_trigger_tools_test extends \advanced_testcase {
final class manual_trigger_tools_test extends \advanced_testcase {
/** Icon of the manual trigger 1. */
const MANUAL_TRIGGER1_ICON = 't/up';
/** Display name of the manual trigger 1. */
......@@ -87,7 +87,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() {
public function test_get_manual_trigger_tools_for_one_active_workflow(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
$tools = workflow_manager::get_manual_trigger_tools_for_active_workflows();
$this->assertCount(1, $tools);
......@@ -102,7 +102,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() {
public function test_get_manual_trigger_tools_for_active_workflows(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
$tools = workflow_manager::get_manual_trigger_tools_for_active_workflows();
......
......@@ -47,7 +47,7 @@ use tool_lifecycle\settings_type;
* @copyright 2018 WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class manually_triggered_process_test extends \advanced_testcase {
final class manually_triggered_process_test extends \advanced_testcase {
/** Icon of the manual trigger. */
const MANUAL_TRIGGER1_ICON = 't/up';
/** Display name of the manual trigger. */
......@@ -95,7 +95,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() {
public function test_proceeding_of_manually_triggered_processes(): void {
$process = process_manager::manually_trigger_process($this->course->id, $this->trigger->id);
$this->assertEquals(0, $process->stepindex);
......
......@@ -40,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 persist_process_data_test extends \advanced_testcase {
final class persist_process_data_test extends \advanced_testcase {
/** @var process $process Instance of the process. */
private $process;
......@@ -70,7 +70,7 @@ class persist_process_data_test 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() {
public function test_get_set_process_data(): void {
$step = step_manager::get_step_instance_by_workflow_index($this->process->workflowid, $this->process->stepindex);
process_data_manager::set_process_data(
$this->process->id,
......
......@@ -39,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 persist_process_test extends \advanced_testcase {
final class persist_process_test extends \advanced_testcase {
/** @var workflow $workflow Instance of the workflow. */
private $workflow;
......@@ -63,7 +63,7 @@ class persist_process_test extends \advanced_testcase {
* Test the creation of a process.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_create() {
public function test_create(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
$this->assertNotNull($process);
$this->assertNotEmpty($process->id);
......@@ -77,7 +77,7 @@ class persist_process_test extends \advanced_testcase {
* Tests setting a process on waiting.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_waiting() {
public function test_process_waiting(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
$this->assertFalse($process->waiting);
process_manager::set_process_waiting($process);
......@@ -89,7 +89,7 @@ class persist_process_test extends \advanced_testcase {
* Tests deletion of a process when rolledback.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_rollback() {
public function test_process_rollback(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
delayed_courses_manager::set_course_delayed($process->courseid, get_config('tool_lifecycle', 'duration'));
process_manager::rollback_process($process);
......@@ -101,7 +101,7 @@ class persist_process_test extends \advanced_testcase {
* Tests proceeding a process to the next step.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_proceed() {
public function test_process_proceed(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
$this->assertEquals(0, $process->stepindex);
process_manager::proceed_process($process);
......
......@@ -39,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 persist_step_test extends \advanced_testcase {
final class persist_step_test extends \advanced_testcase {
/** @var workflow $workflow Instance of the workflow. */
private $workflow;
......@@ -63,7 +63,7 @@ class persist_step_test 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() {
public function test_add_step(): void {
$step = $this->generator->create_step(
'instance1',
'subpluginname',
......@@ -77,7 +77,7 @@ class persist_step_test 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() {
public function test_add_multiple_steps(): void {
$step1 = $this->generator->create_step(
'instance1',
'subpluginname',
......@@ -99,7 +99,7 @@ class persist_step_test extends \advanced_testcase {
* Test that the step can be removed correctly.
* @covers \tool_lifecycle\local\manager\step_manager
*/
public function test_remove_step() {
public function test_remove_step(): void {
$step1 = $this->generator->create_step(
'instance1',
'subpluginname',
......@@ -132,7 +132,7 @@ class persist_step_test 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() {
public function test_add_after_remove_step(): void {
$step1 = $this->generator->create_step(
'instance1',
'subpluginname',
......
......@@ -38,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 persist_workflow_test extends \advanced_testcase {
final class persist_workflow_test extends \advanced_testcase {
/** @var workflow $workflow Instance of the workflow. */
private $workflow;
......@@ -58,7 +58,7 @@ class persist_workflow_test extends \advanced_testcase {
* Test the creation of a process.
* @covers \tool_lifecycle\local\manager\workflow_manager create a wf.
*/
public function test_create() {
public function test_create(): void {
$this->assertNull($this->workflow->id);
workflow_manager::insert_or_update($this->workflow);
$this->assertNotNull($this->workflow->id);
......
......@@ -49,7 +49,7 @@ use tool_lifecycle\processor;
* @copyright 2019 Justus Dieckmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class privacy_test extends provider_testcase {
final class privacy_test extends provider_testcase {
/** Icon of the manual trigger. */
......@@ -100,7 +100,7 @@ class privacy_test extends provider_testcase {
* @throws \invalid_parameter_exception
* @throws \moodle_exception
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
$u1 = $this->getDataGenerator()->create_user();
......@@ -130,7 +130,7 @@ class privacy_test extends provider_testcase {
* @throws \invalid_parameter_exception
* @throws \moodle_exception
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
$u1 = $this->getDataGenerator()->create_user();
......@@ -169,7 +169,7 @@ class privacy_test extends provider_testcase {
* @throws \invalid_parameter_exception
* @throws \moodle_exception
*/
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
$c1 = $this->getDataGenerator()->create_course();
$u1 = $this->getDataGenerator()->create_user();
......@@ -195,7 +195,7 @@ class privacy_test extends provider_testcase {
* @throws \invalid_parameter_exception
* @throws \moodle_exception
*/
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
......@@ -229,7 +229,7 @@ class privacy_test extends provider_testcase {
* @throws \invalid_parameter_exception
* @throws \moodle_exception
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
$u1 = $this->getDataGenerator()->create_user();
......@@ -258,7 +258,7 @@ class privacy_test extends provider_testcase {
* @throws \invalid_parameter_exception
* @throws \moodle_exception
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
global $DB;
$c1 = $this->getDataGenerator()->create_course();
$c2 = $this->getDataGenerator()->create_course();
......
......@@ -41,7 +41,7 @@ use tool_lifecycle\local\manager\process_manager;
* @copyright 2022 Justus Dieckmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class process_error_test extends \advanced_testcase {
final class process_error_test extends \advanced_testcase {
/** Icon of the manual trigger. */
const MANUAL_TRIGGER1_ICON = 't/up';
/** Display name of the manual trigger. */
......@@ -92,7 +92,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() {
public function test_process_error_in_table(): void {
global $DB;
$process = process_manager::manually_trigger_process($this->course->id, $this->trigger->id);
......
......@@ -35,7 +35,7 @@ use tool_lifecycle\local\manager\workflow_manager;
* @copyright 2018 Tamara Gunkel, Jan Dageforde WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class process_status_message_test extends \advanced_testcase {
final class process_status_message_test extends \advanced_testcase {
/** Icon of the manual trigger. */
const MANUAL_TRIGGER1_ICON = 't/up';
/** Display name of the manual trigger. */
......@@ -76,7 +76,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() {
public function test_get_status_message(): void {
$process = $this->generator->create_process(2, $this->workflow->id);
$message = \tool_lifecycle\local\manager\interaction_manager::get_process_status_message($process->id);
$this->assertEquals(get_string("workflow_started", "tool_lifecycle"), $message);
......
......@@ -39,7 +39,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 settings_manager_test extends \advanced_testcase {
final class settings_manager_test extends \advanced_testcase {
/** @var step_subplugin $step Instance of the step plugin. */
private $step;
......@@ -71,7 +71,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() {
public function test_set_get_step_settings(): void {
$data = new \stdClass();
$data->subject = self::EMAIL_VALUE;
settings_manager::save_settings($this->step->id, settings_type::STEP, $this->step->subpluginname, $data);
......@@ -84,7 +84,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() {
public function test_set_get_trigger_settings(): void {
$data = new \stdClass();
$data->delay = self::STARTDELAY_VALUE;
settings_manager::save_settings($this->trigger->id, settings_type::TRIGGER, $this->trigger->subpluginname, $data);
......@@ -97,7 +97,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() {
public function test_remove_workflow(): void {
global $DB;
$data = new \stdClass();
$data->subject = self::EMAIL_VALUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment