ResultProcessor - add support of the "add_participants" method

This commit is contained in:
Meritoo
2017-09-25 21:10:54 +02:00
parent af2df98d14
commit 959e9481fd
3 changed files with 13 additions and 0 deletions

View File

@@ -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;

View File

@@ -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,

View File

@@ -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,