Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #18823: STATA Export fails with certain question types #3220

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}
}