Skip to content

Commit

Permalink
Addressing failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersoncasimir committed Feb 11, 2025
1 parent e94ec03 commit 80bc50f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class CandidateQueryEngine extends \LORIS\Data\Query\SQLQueryEngine
return 'c.PSCID';
case 'Site':
$this->addTable(
"LEFT JOIN session s ON (s.CandidateIDID=c.ID AND s.Active='Y')"
"LEFT JOIN session s ON (s.CandidateID=c.ID AND s.Active='Y')"
);
$this->addTable('LEFT JOIN psc site ON (s.CenterID=site.CenterID)');
return 'site.Name';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ function testCohortMatches()
],
[
'ID' => 2,
'CandidateID' => 1,
'CandidateID' => 2,
'CenterID' => '2',
'ProjectID' => '2',
'CohortID' => '2',
Expand Down
18 changes: 10 additions & 8 deletions modules/mri_violations/test/mri_violationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function setUp(): void
$this->DB->insert(
"candidate",
[
'ID' => 1,
'CandID' => '999888',
'RegistrationCenterID' => '55',
'UserID' => '1',
Expand All @@ -78,6 +79,7 @@ public function setUp(): void
$this->DB->insert(
"candidate",
[
'ID' => 2,
'CandID' => '999777',
'RegistrationCenterID' => '55',
'UserID' => '2',
Expand All @@ -89,7 +91,7 @@ public function setUp(): void
"session",
[
'ID' => '9888',
'CandID' => '999888',
'CandidateID' => 1,
'CenterID' => '55',
'ProjectID' => '7777',
'UserID' => '1',
Expand All @@ -102,7 +104,7 @@ public function setUp(): void
"session",
[
'ID' => '9777',
'CandID' => '999777',
'CandidateID' => 2,
'CenterID' => '55',
'ProjectID' => '7777',
'UserID' => '2',
Expand Down Expand Up @@ -176,7 +178,7 @@ public function setUp(): void
"mri_protocol_violated_scans",
[
'ID' => '1001',
'CandID' => '999888',
'CandidateID' => 1,
'PatientName' => '[Test]PatientName_Test1',
'time_run' => '2009-06-29 04:00:44',
'minc_location' => 'assembly/test/test/mri/test/test.mnc',
Expand All @@ -190,7 +192,7 @@ public function setUp(): void
"mri_protocol_violated_scans",
[
'ID' => '1002',
'CandID' => '999777',
'CandidateID' => 2,
'PatientName' => '[name]test_Test2',
'time_run' => '2008-06-29 04:00:44',
'minc_location' => 'assembly/test2/test2/mri/test2/test2.mnc',
Expand Down Expand Up @@ -250,15 +252,15 @@ public function tearDown(): void
$this->DB->delete(
"session",
[
'CandID' => '999888',
'CenterID' => '55',
'CandidateID' => 1,
'CenterID' => '55',
]
);
$this->DB->delete(
"session",
[
'CandID' => '999777',
'CenterID' => '55',
'CandidateID' => 2,
'CenterID' => '55',
]
);
$this->DB->delete(
Expand Down
2 changes: 1 addition & 1 deletion php/libraries/Candidate.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Candidate implements \LORIS\StudyEntities\AccessibleResource,
FROM candidate as c
LEFT JOIN psc as p ON (p.CenterID=c.RegistrationCenterID)
LEFT JOIN users as u1 ON (u1.UserID = c.RegisteredBy)
WHERE c.CandID=:CandidateID AND c.Active = 'Y'";
WHERE c.CandID=:Candidate AND c.Active = 'Y'";

$row = $db->pselectRow($query, $CandArray);

Expand Down
9 changes: 5 additions & 4 deletions raisinbread/test/api/LorisApiAuthenticatedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LorisApiAuthenticatedTest extends LorisIntegrationTest
protected $base_uri;
protected $originalJwtKey;
protected $configIdJwt;

/**
* Overrides LorisIntegrationTest::setUp() to store the current JWT key
* and replaces it for an acceptable one.
Expand Down Expand Up @@ -80,6 +80,7 @@ public function setUp(): void
$this->DB->insert(
"candidate",
[
'ID' => 1,
'CandID' => '900000',
'PSCID' => 'TST0001',
'RegistrationCenterID' => 1,
Expand All @@ -94,7 +95,7 @@ public function setUp(): void
'session',
[
'ID' => '999999',
'CandID' => '900000',
'CandidateID' => 1,
'Visit_label' => 'V1',
'CenterID' => 1,
'ProjectID' => 1,
Expand Down Expand Up @@ -236,8 +237,8 @@ public function tearDown(): void
],
);
$this->DB->delete("flag", ['ID' => '999999']);
$this->DB->delete("session", ['CandID' => '900000']);
$this->DB->delete("candidate", ['CandID' => '900000']);
$this->DB->delete("session", ['CandidateID' => 1]);
$this->DB->delete("candidate", ['ID' => 1]);
$this->DB->delete("test_names", ['ID' => '999999']);

$set = [
Expand Down
2 changes: 1 addition & 1 deletion raisinbread/test/api/LorisApiAuthenticated_v0_0_3_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function tearDown(): void
);

$this->DB->delete("session", ['ID' => '999999']);
$this->DB->delete("candidate", ['ID' => '999999']);
$this->DB->delete("candidate", ['ID' => 1]);
$this->DB->delete("flag", ['ID' => '999999']);
$this->DB->delete("test_names", ['ID' => '999999']);

Expand Down

0 comments on commit 80bc50f

Please sign in to comment.