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 12, 2025
1 parent 80bc50f commit 70b357b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions modules/candidate_parameters/ajax/getData.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function getProbandInfoFields()
// Calculate age difference
$ageDifference = "Could not calculate age";
$candidateDOB = $db->pselectOne(
"SELECT DoB FROM candidate WHERE ID=:CandidateID",
"SELECT DoB FROM candidate WHERE CandID=:CandidateID",
['CandidateID' => $candID]
);
if (!empty($candidateDOB) && !empty($dob)) {
Expand Down Expand Up @@ -370,8 +370,8 @@ function getParticipantStatusFields()
}

$query = "SELECT participant_status, participant_suboptions, reason_specify
FROM parameter_candidate pc
JOIN candidate c ON c.ID=pc.CandidateID
FROM participant_status ps
JOIN candidate c ON c.ID=ps.CandidateID
WHERE c.CandID=:cid";
$row = $db->pselectRow($query, ['cid' => $candID]);

Expand Down Expand Up @@ -540,7 +540,7 @@ function getDOBFields(): array
$db = \NDB_Factory::singleton()->database();
// Get PSCID
$candidateData = $db->pselectRow(
'SELECT PSCID,DoB FROM candidate where ID =:candid',
'SELECT PSCID,DoB FROM candidate where CandID =:candid',
['candid' => $candID->__toString()]
);
$pscid = $candidateData['PSCID'] ?? null;
Expand Down Expand Up @@ -576,7 +576,7 @@ function getDODFields(): array
$db = \NDB_Factory::singleton()->database();

$candidateData = $db->pselectRow(
'SELECT PSCID,DoD, DoB FROM candidate where ID =:candid',
'SELECT PSCID,DoD, DoB FROM candidate where CandID =:candid',
['candid' => $candID]
);
if ($candidateData === null) {
Expand Down Expand Up @@ -625,7 +625,7 @@ function getDiagnosisEvolutionFields(): array

$pscid = $db->pselectOne(
"SELECT PSCID FROM candidate
WHERE ID=:candID",
WHERE CandID=:candID",
['candID' => $candID]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ function setUp(): void
$this->DB->insert(
"candidate",
[
'ID' => 1,
'CandID' => '000001',
'PSCID' => 'DCC0001',
'ID' => 2,
'CandID' => '000002',
'PSCID' => 'DCC0002',
'RegistrationCenterID' => 253,
'RegistrationProjectID' => 2,
'Active' => 'Y',
Expand All @@ -80,7 +80,7 @@ function setUp(): void
'session',
[
'ID' => '999997',
'CandidateID' => 1,
'CandidateID' => 2,
'Visit_label' => 'Test0',
'CenterID' => 253,
'ProjectID' => 2,
Expand Down Expand Up @@ -164,14 +164,14 @@ function tearDown() : void
'session',
[
'ID' => 999997,
'CandidateID' => 1
'CandidateID' => 2
]
);
$this->DB->delete(
"candidate",
[
'CandID' => '000001',
'PSCID' => 'DCC0001',
'CandID' => '000002',
'PSCID' => 'DCC0002',
]
);
$this->DB->delete(
Expand Down
4 changes: 2 additions & 2 deletions php/libraries/NDB_BVL_Feedback.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class NDB_BVL_Feedback

$qparams['SID'] = $this->_feedbackObjectInfo['SessionID'];
} elseif (!empty($this->_feedbackObjectInfo['CandID'])) {
$query .= " WHERE c.ID = :CaID";
$query .= " WHERE c.CandID = :CaID";
$qparams['CaID'] = (string) $this->_feedbackObjectInfo['CandID'];
} else {
throw new InvalidArgumentException(
Expand Down Expand Up @@ -418,7 +418,7 @@ class NDB_BVL_Feedback
$query = "SELECT COUNT(*)
FROM feedback_bvl_thread fbt
JOIN candidate c ON c.ID=fbt.CandidateID
WHERE Active ='Y' AND Public = 'Y' AND Status <> 'closed'";
WHERE fbt.Active ='Y' AND Public = 'Y' AND Status <> 'closed'";
$qparams = [];
if (!empty($this->_feedbackObjectInfo['CommentID'])) {
$query .= " AND CommentID = :ComID";
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/studyentities/CandID_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function invalidValues(): array
[' 11111'],
['111111a'],
['a111111'],
['1111111']
['11111111111']
];
}

Expand Down

0 comments on commit 70b357b

Please sign in to comment.