View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 16771 | Bug reports | Other | public | 2020-10-21 17:52 | 2026-11-20 12:23 |
| Reporter | ollehar | Assigned To | |||
| Priority | none | Severity | minor | ||
| Status | acknowledged | Resolution | open | ||
| Summary | 16771: Create unit-tests for all (some?) events | ||||
| Description | Having events break is bad. Unit-tests would make sure we don't break compatibility by mistake, like with question attributes. | ||||
| Tags | No tags attached. | ||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | |||||
| I will donate to the project if issue is resolved | |||||
| Browser | |||||
| Database type & version | |||||
| Server OS (if known) | |||||
| Webserver software & version (if known) | |||||
| PHP Version | |||||
| Git branch / Pull Request URL | |||||
|
core plugins can be used for events testing. |
|
|
I was hoping a test suite could be created independent of installing plugins etc. We can't make a core plugin for every event in the software. |
|
|
You just check if the event happen, not if it does the functionality. You spoke for question attributes : |
|
Hm! If we have a function foo() that contains event E, then we must check that the return values of foo() can be affected by E properly. |
|
|
Yes, sure : but : in my opinion it's really complex to know what exact function use it :). |
|
|
Well, then we need to do integrity tests to test that plugin. Not fun. |
|
|
LimeSurvey: master 704a6627 2026-11-20 12:22 Details Diff |
Dev Added unit tests for the plugin events of survey activation and deactivation, of saving and deleting responses and participants, and of taking a survey (issue 16771) Dev Events covered: before/afterSurveyActivate, before/afterSurveyDeactivate, before/afterResponseSave, before/afterResponseDelete, before/afterTokenSave, before/afterTokenDelete, before/afterModelSave, before/afterModelDelete, afterFindSurvey, beforeSurveyPage, beforeQuestionRender and afterSurveyComplete Dev setNoAnswerMode() no longer defines SHOW_NO_ANSWER and PRESELECT_NO_ANSWER a second time, so tests can render several survey pages in one process |
Affected Issues 16771 |
|
| mod - application/helpers/qanda_helper.php | Diff File | ||
| add - tests/data/plugins/EventRecorderPlugin.php | Diff File | ||
| add - tests/unit/events/ResponseAndParticipantModelEventsTest.php | Diff File | ||
| add - tests/unit/events/SurveyActivationEventsTest.php | Diff File | ||
| add - tests/unit/events/SurveyRuntimeEventsTest.php | Diff File | ||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2020-10-21 17:52 | ollehar | New Issue | |
| 2020-10-21 17:52 | ollehar | Description Updated | |
| 2020-10-21 19:09 | DenisChenu | Note Added: 60348 | |
| 2020-10-22 11:26 | ollehar | Note Added: 60353 | |
| 2020-10-22 11:32 | DenisChenu | Note Added: 60355 | |
| 2020-10-22 11:37 | ollehar | Note Added: 60356 | |
| 2020-10-22 12:37 | DenisChenu | Note Added: 60360 | |
| 2020-10-22 12:40 | ollehar | Note Added: 60361 | |
| 2020-10-22 12:40 | ollehar | Note Edited: 60361 | |
| 2026-11-19 22:50 | c_schmitz | Status | new => acknowledged |
| 2026-11-20 12:23 | c_schmitz | Changeset attached | => LimeSurvey master 704a6627 |