Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug #18627: Missing SQL query errors in admin mail (SQL CODE TH…
…AT FAILED) (#3372) Co-authored-by: Lapiu Dev <devgit@lapiu.biz>
- Loading branch information
1 parent
ea588db
commit 19d1cad
Showing
5 changed files
with
70 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
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
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,50 @@ | ||
<?php | ||
|
||
namespace ls\tests; | ||
|
||
use Yii; | ||
|
||
class SurveyDynamicTest extends TestBaseClass | ||
{ | ||
public static function setUpBeforeClass(): void | ||
{ | ||
parent::setupBeforeClass(); | ||
|
||
// Import survey. | ||
$filename = self::$surveysFolder . '/limesurvey_survey_161359_quickTranslation.lss'; | ||
self::importSurvey($filename); | ||
|
||
// Activate survey. | ||
$activator = new \SurveyActivator(self::$testSurvey); | ||
$activator->activate(); | ||
} | ||
|
||
public static function tearDownAfterClass(): void | ||
{ | ||
parent::tearDownAfterClass(); | ||
} | ||
|
||
/** | ||
* Testing that a new response can be correctly inserted. | ||
*/ | ||
public function testInsertResponse() | ||
{ | ||
$responseId = \SurveyDynamic::model(self::$surveyId)->insertRecords(array('startlanguage' => 'en')); | ||
$response = \SurveyDynamic::model()->findByPk($responseId); | ||
|
||
$this->assertIsNumeric($responseId, 'The newly inserted response id should have been returned.'); | ||
$this->assertInstanceOf('SurveyDynamic', $response, 'The newly inserted response should have been returned.'); | ||
} | ||
|
||
/** | ||
* Testing that an exception is thrown when | ||
* response insertion fails. | ||
*/ | ||
public function testErrorInsertingResponse() | ||
{ | ||
$this->expectException(\CException::class); | ||
|
||
// Table column name incorrectly spelled. | ||
$responseId = \SurveyDynamic::model(self::$surveyId)->insertRecords(array('starlanguage' => 'en')); | ||
} | ||
} |