Skip to content

Commit

Permalink
DEV: surveyActivator : tests - assert tables created
Browse files Browse the repository at this point in the history
  • Loading branch information
TonisOrmisson committed Jan 29, 2018
1 parent f7f063c commit 5f19a87
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/controllers/SurveyActivatorTest.php
Expand Up @@ -43,6 +43,33 @@ public function testActivateWithTimings(){
$this->assertTrue($result['status']==='OK');
}

public function testParticipantsTableCreated(){
$file = self::$surveysFolder.DIRECTORY_SEPARATOR.'limesurvey_survey_'.self::$surveyWithTimingsID.'.lss';
parent::importSurvey($file);
$activator = new \SurveyActivator(self::$testSurvey);
$result = $activator->activate();
$table = Yii::app()->db->schema->getTable(self::$testSurvey->responsesTableName);
$this->assertNotEmpty($table);
}

public function testTimingsTableCreated(){
$file = self::$surveysFolder.DIRECTORY_SEPARATOR.'limesurvey_survey_'.self::$surveyWithTimingsID.'.lss';
parent::importSurvey($file);
$activator = new \SurveyActivator(self::$testSurvey);
$result = $activator->activate();
$table = Yii::app()->db->schema->getTable(self::$testSurvey->timingsTableName);
$this->assertNotEmpty($table);
}

public function testTimingsTableNotCreated(){
$file = self::$surveysFolder.DIRECTORY_SEPARATOR.'limesurvey_survey_'.self::$surveyWithoutTimingsID.'.lss';
parent::importSurvey($file);
$activator = new \SurveyActivator(self::$testSurvey);
$result = $activator->activate();
$table = Yii::app()->db->schema->getTable(self::$testSurvey->timingsTableName);
$this->assertEmpty($table);
}

public function testActivateWithoutTimings(){
$file = self::$surveysFolder.DIRECTORY_SEPARATOR.'limesurvey_survey_'.self::$surveyWithoutTimingsID.'.lss';
parent::importSurvey($file);
Expand Down

0 comments on commit 5f19a87

Please sign in to comment.