Skip to content

Commit

Permalink
Dev: Add test for issue #18823: STATA Export fails with certain quest…
Browse files Browse the repository at this point in the history
…ion types (#3220)

Co-authored-by: Lapiu Dev <devgit@lapiu.biz>
  • Loading branch information
gabrieljenik and lapiudevgit committed Jun 14, 2023
1 parent 52b5c08 commit da05975
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/unit/helpers/remotecontrol/ExportResponsesStataXmlTest.php
@@ -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);
}
}

0 comments on commit da05975

Please sign in to comment.