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 0adbe28 commit 3eea7d7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
8 changes: 4 additions & 4 deletions modules/survey_accounts/test/survey_accountsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function setUp(): void
$this->DB->insert(
"candidate",
[
'ID' => 222,
'ID' => 112,
'CandID' => '999999',
'RegistrationCenterID' => '55',
'UserID' => '1',
Expand All @@ -108,7 +108,7 @@ public function setUp(): void
"session",
[
'ID' => '111112',
'CandidateID' => 222,
'CandidateID' => 112,
'CenterID' => '1',
'ProjectID' => '1',
'UserID' => '1',
Expand Down Expand Up @@ -141,15 +141,15 @@ public function tearDown(): void
);
$this->DB->delete(
"session",
['CandidateID' => 111]
['ID' => '111111']
);
$this->DB->delete(
"candidate",
['CandID' => '999888']
);
$this->DB->delete(
"session",
['CandidateID' => 222]
['ID' => '111112']
);
$this->DB->delete(
"candidate",
Expand Down
13 changes: 8 additions & 5 deletions raisinbread/test/api/LorisApiInstrumentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ public function testPostCandidatesCandidVisitInstruments(): void
{
// Remove all instruments from this CandID.
$SessionID = $this->DB->pselectOne(
"SELECT ID FROM session WHERE Visit_label=:VL AND CandID=:Candidate",
"SELECT s.ID
FROM session s
JOIN candidate c ON c.ID=s.CandidateID
WHERE Visit_label=:VL AND CandID=:Candidate",
[
'VL' => $this->visitTest,
'Candidate' => $this->candidTest
Expand Down Expand Up @@ -312,7 +315,7 @@ public function testPatchCandidatesCandidVisitInstrumentsInstrumentFlags(): void
'Flags' => [
'Data_entry' => 'Complete',
'Administration' => 'All',
'Validity' => 'Invalid'
'Validity' => 'Invalid'
]
];
$response = $this->client->request(
Expand Down Expand Up @@ -387,7 +390,7 @@ public function testPutCandidatesCandidVisitInstrumentsInstrumentFlags(): void
'Flags' => [
'Data_entry' => 'Complete',
'Administration' => 'Partial',
'Validity' => 'Questionable'
'Validity' => 'Questionable'
]
];
$response = $this->client->request(
Expand Down Expand Up @@ -569,7 +572,7 @@ public function testPatchCandidVisitInstrumentsInstrumentDdeFlags(): void
'Flags' => [
'Data_entry' => 'Complete',
'Administration' => 'All',
'Validity' => 'Valid'
'Validity' => 'Valid'
]
];
$response = $this->client->request(
Expand Down Expand Up @@ -624,7 +627,7 @@ public function testPutCandidVisitInstrumentsInstrumentDdeFlags(): void
'Flags' => [
'Data_entry' => 'Complete',
'Administration' => 'All',
'Validity' => 'Valid'
'Validity' => 'Valid'
]
];
$response = $this->client->request(
Expand Down
6 changes: 4 additions & 2 deletions test/unittests/CandidateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1199,11 +1199,13 @@ public function testParticipantStatusDescription()
]
]
);
echo "PSCID CandID: " . $this->_candidate->getPSCID() . ' ' . $this->_candidate->getCandID();
$result = $this->_candidate->getParticipantStatusDescription($this->_DB);
$this->_DB->run("DROP TEMPORARY TABLE participant_status_options");
$this->_DB->run("DROP TEMPORARY TABLE participant_status");
$this->assertEquals($result, 'description2');
$this->assertEquals(
$this->_candidate->getPSCID() . '--' . $this->_candidate->getCandID(),
'description2'
);
}

/**
Expand Down

0 comments on commit 3eea7d7

Please sign in to comment.