Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vcestone committed Aug 9, 2023
1 parent fd106f9 commit 7d924db
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ public function testExportResponsesByTokensArray()

$result = $this->handler->export_responses_by_token($sessionKey, self::$surveyId, 'json', array('token3', 'token4'));
$this->assertNotNull($result);
fwrite(STDERR, print_r(self::$surveyId, TRUE) . PHP_EOL);
$aTokensQuoted = Array();
foreach (array('token3', 'token4') as $token) {
array_push($aTokensQuoted, App()->db->quoteValue("$token"));
}
$tokenFilter = " IN (" . implode(",", $aTokensQuoted) . ")";
fwrite(STDERR, print_r($tokenFilter TRUE) . PHP_EOL);

$responses = json_decode(file_get_contents($result->fileName), true);
fwrite(STDERR, print_r(json_encode($responses), TRUE));
fwrite(STDERR, print_r(json_encode($responses), TRUE) . PHP_EOL);
$nrresponses = count($responses['responses']);
$this->assertTrue($nrresponses === 2, 'Two responses should have been exported. Found: ' . $nrresponses);
$this->assertTrue($responses['responses'][0]['token'] === 'token3', 'Response with token3 was expected');
Expand Down

0 comments on commit 7d924db

Please sign in to comment.