From cacb2b3b92cb92fd37e777918d87a35367fa758c Mon Sep 17 00:00:00 2001 From: Meritoo Date: Fri, 29 Sep 2017 14:20:31 +0200 Subject: [PATCH] ParticipantService - getParticipant() method - get all participants of survey first (to avoid problem when participants exist but are not loaded) --- src/Service/ParticipantService.php | 5 +++++ tests/Service/ParticipantServiceTest.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Service/ParticipantService.php b/src/Service/ParticipantService.php index c0218fe..89a4342 100644 --- a/src/Service/ParticipantService.php +++ b/src/Service/ParticipantService.php @@ -160,6 +160,11 @@ class ParticipantService */ public function getParticipant($surveyId, $email) { + /* + * I have to get all participants of survey to avoid problem when participants exist but are not loaded + */ + $this->getSurveyParticipants($surveyId); + return $this ->allParticipants ->getParticipantOfSurvey($surveyId, $email); diff --git a/tests/Service/ParticipantServiceTest.php b/tests/Service/ParticipantServiceTest.php index 4a41c39..eb73ecc 100644 --- a/tests/Service/ParticipantServiceTest.php +++ b/tests/Service/ParticipantServiceTest.php @@ -125,7 +125,7 @@ class ParticipantServiceTest extends BaseTestCase public function testGetParticipant() { - $rpcClientManager = $this->getJsonRpcClientManager(0); + $rpcClientManager = $this->getJsonRpcClientManager(1); $sessionManager = $this->getSessionManager(); $this->createServiceWithoutParticipants($rpcClientManager, $sessionManager);