diff --git a/src/Meritoo/LimeSurvey/ApiClient/Result/Processor/ResultProcessor.php b/src/Meritoo/LimeSurvey/ApiClient/Result/Processor/ResultProcessor.php index 2d13850..7e1b46c 100644 --- a/src/Meritoo/LimeSurvey/ApiClient/Result/Processor/ResultProcessor.php +++ b/src/Meritoo/LimeSurvey/ApiClient/Result/Processor/ResultProcessor.php @@ -81,6 +81,7 @@ class ResultProcessor $method = MethodType::getValidatedMethod($method); switch ($method) { + case MethodType::ADD_PARTICIPANTS: case MethodType::GET_PARTICIPANT_PROPERTIES: $item = new Participant(); break; diff --git a/src/Meritoo/LimeSurvey/ApiClient/Type/MethodType.php b/src/Meritoo/LimeSurvey/ApiClient/Type/MethodType.php index 499222f..c9ee1ce 100644 --- a/src/Meritoo/LimeSurvey/ApiClient/Type/MethodType.php +++ b/src/Meritoo/LimeSurvey/ApiClient/Type/MethodType.php @@ -19,6 +19,16 @@ use Meritoo\LimeSurvey\ApiClient\Exception\UnknownMethodException; */ class MethodType extends BaseType { + /** + * Add participants to the tokens collection of the survey + * + * Returns the inserted data including additional new information like the Token entry ID and the token string. + * In case of errors in some data, return it in errors. + * + * @var string + */ + const ADD_PARTICIPANTS = 'add_participants'; + /** * Add a response to the survey responses collection. * Returns the id of the inserted survey response. @@ -104,6 +114,7 @@ class MethodType extends BaseType $method = static::getValidatedMethod($method); return in_array($method, [ + static::ADD_PARTICIPANTS, static::LIST_PARTICIPANTS, static::LIST_QUESTIONS, static::LIST_SURVEYS, diff --git a/tests/Meritoo/LimeSurvey/Test/ApiClient/Type/MethodTypeTest.php b/tests/Meritoo/LimeSurvey/Test/ApiClient/Type/MethodTypeTest.php index 4def3cc..d4571d0 100644 --- a/tests/Meritoo/LimeSurvey/Test/ApiClient/Type/MethodTypeTest.php +++ b/tests/Meritoo/LimeSurvey/Test/ApiClient/Type/MethodTypeTest.php @@ -162,6 +162,7 @@ class MethodTypeTest extends BaseTypeTestCase protected function getAllExpectedTypes() { return [ + 'ADD_PARTICIPANTS' => MethodType::ADD_PARTICIPANTS, 'ADD_RESPONSE' => MethodType::ADD_RESPONSE, 'EXPORT_STATISTICS' => MethodType::EXPORT_STATISTICS, 'GET_PARTICIPANT_PROPERTIES' => MethodType::GET_PARTICIPANT_PROPERTIES,