mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 10:11:49 +01:00
Participants collection - disable method has(), because hasParticipantsOfSurvey() should be used to verify if there are participants of given survey
This commit is contained in:
@@ -40,6 +40,14 @@ class Participants extends Collection
|
|||||||
throw new DisabledMethodException(__METHOD__, 'addParticipants');
|
throw new DisabledMethodException(__METHOD__, 'addParticipants');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function has($element)
|
||||||
|
{
|
||||||
|
throw new DisabledMethodException(__METHOD__, 'hasParticipantsOfSurvey');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds participants of given survey
|
* Adds participants of given survey
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ class ParticipantsTest extends BaseTestCase
|
|||||||
(new Participants())->addMultiple([]);
|
(new Participants())->addMultiple([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testHas()
|
||||||
|
{
|
||||||
|
$this->expectException(DisabledMethodException::class);
|
||||||
|
(new Participants())->has(new Participant());
|
||||||
|
}
|
||||||
|
|
||||||
public function testAddParticipantsWithoutParticipants()
|
public function testAddParticipantsWithoutParticipants()
|
||||||
{
|
{
|
||||||
$surveyId = 1;
|
$surveyId = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user