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 7d924db commit 9c841fa
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +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);
fwrite(STDERR, print_r(self::$surveyId . PHP_EOL, TRUE));
$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);
fwrite(STDERR, print_r($tokenFilter . PHP_EOL, TRUE));

$responses = json_decode(file_get_contents($result->fileName), true);
fwrite(STDERR, print_r(json_encode($responses), TRUE) . PHP_EOL);
fwrite(STDERR, print_r(json_encode($responses) . PHP_EOL, TRUE));
$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 9c841fa

Please sign in to comment.