Skip to content

Commit

Permalink
Revised test adding token3 check
Browse files Browse the repository at this point in the history
  • Loading branch information
vcestone committed Aug 9, 2023
1 parent 87c1ac9 commit 9873089
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ public function testExportResponsesByToken2()
$this->assertTrue($responses['responses'][0]['token'] === 'token2', 'Response with token2 was expected');
}

/**
* Export responses by token3.
*/
public function testExportResponsesByToken3()
{
$sessionKey = $this->handler->get_session_key($this->getUsername(), $this->getPassword());

$result = $this->handler->export_responses_by_token($sessionKey, self::$surveyId, 'json', 'token3');
$this->assertNotNull($result);

$responses = json_decode(file_get_contents($result->fileName), true);
fwrite(STDERR, print_r(json_encode($responses) . PHP_EOL, TRUE));
$this->assertTrue(count($responses['responses']) === 1, 'One response exported was expected.');
$this->assertTrue($responses['responses'][0]['token'] === 'token3', 'Response with token2 was expected');
}

/**
* Export responses by tokens array.
*/
Expand Down

0 comments on commit 9873089

Please sign in to comment.