Skip to content

Commit

Permalink
Fixed issue with inclusion mode tests
Browse files Browse the repository at this point in the history
It was due to the wrong phase being set to have custom config in the affected phases test.
  • Loading branch information
AbdelhamidRouatbi committed Aug 25, 2024
1 parent 36c5454 commit 90f1a86
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 0 additions & 2 deletions relis_app/controllers/test/Unit_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ function __construct()
$this->apiQueryUnitTest = new ApiQueryUnitTest();
$this->opUnitTest = new OpUnitTest();
$this->inclusion_mode_conflictUnitTest = new inclusion_mode_conflictUnitTest();
//$this->screeningInclusionModeConflictsTest = new X
//$this->customScreeningPhaseConfigTest = new X
}

public function relis_unit_test($result = "html_report")
Expand Down
10 changes: 5 additions & 5 deletions relis_app/helpers/tests/inclusion_mode_conflict_ut_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function run_tests() {
$this->defaultCriteria_one();
$this->keepOneFromAny();
$this->keepOneFromAll();
$this->resetScreening();
$this->resetScreening();
}

private function TestInitialize() {
Expand Down Expand Up @@ -75,14 +75,14 @@ private function affected_phases() {
$action = "get_affected_phases (Model method)";
$test_name = "Testing is changes are made to the right affected phases";
$test_aspect = "Affected phases";
$expected_value = json_encode(array(1));
$expected_value = json_encode(array(3));
$actual_value = "";

addScreeningPhase("Link");
$this->ci->db->query("UPDATE relis_dev_correct_" . getProjectShortName() . ".screen_phase_config SET config_type = 'Custom' WHERE screen_phase_config_id = 2");
$this->ci->db->query("UPDATE relis_dev_correct_" . getProjectShortName() . ".screen_phase_config SET config_type = 'Custom' WHERE screen_phase_config_id = 3");

$model = new Screening_dataAccess();
$actual_value = json_encode($model->get_affected_phases(getScreeningPhaseId("Abstract")));
$actual_value = json_encode($model->get_affected_phases(getScreeningPhaseId("Link")));

run_test($this->controller, $action, $test_name, $test_aspect, $actual_value, $actual_value);
}
Expand Down Expand Up @@ -209,7 +209,7 @@ private function keepOneFromAny() {
run_test($this->controller, $action, $test_name, $test_aspect, $expected_value, $actual_value);
}

private function keepOneFromAll() {
private function keepOneFromAll() {
$action = "solve_mode_conflict";
$test_name = "Testing if one random criteria is added properly when switching from All to One inclusion mode";
$test_aspect = "How many criteria were added?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,14 @@ function get_classification_demoTestProject()
$screening['validation_assigment_mode'] = 'Normal';
$screening['status_to_validate'] = 'Excluded';
$screening['validation_percentage'] = '10';
//$screening['inclusion_mode'] = 'One';
$screening['use_kappa'] = true;
$screening['exclusion_criteria'] = array();
array_push($screening['exclusion_criteria'], "EC1: Too short ");
array_push($screening['exclusion_criteria'], "EC2: Not abour chocolate");
/* $screening['inclusion_criteria'] = array();
array_push($screening['inclusion_criteria'], "IC1: Published at most 2 years ago");
array_push($screening['inclusion_criteria'], "IC2: Longer than 10 pages"); */
$screening['source_papers'] = array();
array_push($screening['source_papers'], "Google Scholar");
array_push($screening['source_papers'], "Chocolate DB");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function get_screening_phase_config()

$fields['screening_inclusion_mode'] = $general_config['fields']['screening_inclusion_mode'];
$fields['screening_screening_conflict_resolution'] = $general_config['fields']['screening_screening_conflict_resolution'];
$fields['screening_scscreening_conflict_typereening_conflict_resolution'] = $general_config['fields']['screening_conflict_type'];
$fields['screening_conflict_type'] = $general_config['fields']['screening_conflict_type'];
$fields['assign_papers_on'] = $general_config['fields']['assign_papers_on'];
$fields['screening_result_on'] = $general_config['fields']['screening_result_on'];
$fields['screening_validation_on'] = $general_config['fields']['screening_validation_on'];
Expand Down

0 comments on commit 90f1a86

Please sign in to comment.