mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 02:11:45 +01:00
Participants collection - store instances of ParticipantShort instead of Participant
Required to fix bug "Call to undefined method Meritoo\LimeSurvey\ApiClient\Result\Item\ParticipantShort::isCompleted() in /src/Service/ParticipantService.php on line 206"
This commit is contained in:
@@ -202,14 +202,31 @@ class ParticipantServiceTest extends BaseTestCase
|
||||
$this->serviceWithoutParticipants->hasParticipantFilledSurvey(1, 'john@scott.com');
|
||||
}
|
||||
|
||||
public function testHasParticipantFilledSurvey()
|
||||
public function testHasParticipantFilledSurveyUsingExistingParticipant()
|
||||
{
|
||||
$rpcClientManager = $this->getJsonRpcClientManager(0);
|
||||
$runMethodCallResults = [
|
||||
'firstname' => 'John',
|
||||
'lastname' => 'Scott',
|
||||
'email' => 'john@scott.com',
|
||||
'completed' => 'Y',
|
||||
];
|
||||
|
||||
$rpcClientManager = $this->getJsonRpcClientManager(1, $runMethodCallResults);
|
||||
$sessionManager = $this->getSessionManager();
|
||||
$this->createServiceWithParticipants($rpcClientManager, $sessionManager);
|
||||
|
||||
static::assertTrue($this->serviceWithParticipants->hasParticipantFilledSurvey(1, 'john@scott.com'));
|
||||
static::assertFalse($this->serviceWithParticipants->hasParticipantFilledSurvey(1, 'mary@jane.com'));
|
||||
}
|
||||
|
||||
public function testHasParticipantFilledSurveyUsingNotExistingParticipant()
|
||||
{
|
||||
$this->expectException(MissingParticipantOfSurveyException::class);
|
||||
|
||||
$rpcClientManager = $this->getJsonRpcClientManager(1);
|
||||
$sessionManager = $this->getSessionManager();
|
||||
$this->createServiceWithParticipants($rpcClientManager, $sessionManager);
|
||||
|
||||
$this->serviceWithParticipants->hasParticipantFilledSurvey(3, 'mary@jane.com');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user