Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: Add test for issue #18823: STATA Export fails with certain quest…
…ion types (#3220) Co-authored-by: Lapiu Dev <devgit@lapiu.biz>
- Loading branch information
1 parent
52b5c08
commit da05975
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
tests/unit/helpers/remotecontrol/ExportResponsesStataXmlTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace ls\tests; | ||
|
||
/** | ||
* Tests for ExportSTATAxml. | ||
*/ | ||
class ExportResponsesStataXmlTest extends BaseTest | ||
{ | ||
private static $pluginName = 'ExportSTATAxml'; | ||
|
||
public static function setUpBeforeClass(): void | ||
{ | ||
parent::setUpBeforeClass(); | ||
|
||
\Yii::import('application.helpers.remotecontrol.remotecontrol_handle', true); | ||
\Yii::import('application.helpers.viewHelper', true); | ||
\Yii::import('application.libraries.BigData', true); | ||
|
||
// Activate it, if not already | ||
self::installAndActivatePlugin(self::$pluginName); | ||
|
||
// Import survey | ||
$filename = self::$surveysFolder . '/survey_export_responses_with_tokens.lsa'; | ||
self::importSurvey($filename); | ||
} | ||
|
||
/** | ||
* Get responses in stataxml format. | ||
*/ | ||
public function testGetResponses() | ||
{ | ||
$sessionKey = $this->handler->get_session_key($this->getUsername(), $this->getPassword()); | ||
|
||
$result = $this->handler->export_responses($sessionKey, self::$surveyId, 'stataxml'); | ||
$this->assertNotNull($result); | ||
} | ||
} |