SurveyService - add method that allows to get the "start survey url" using participant's token (instead of whole participant's object)

This commit is contained in:
Meritoo
2017-10-27 16:15:59 +02:00
parent 6f6d4e9119
commit 0d21214bc6
2 changed files with 34 additions and 6 deletions

View File

@@ -181,6 +181,22 @@ class SurveyServiceTest extends BaseTestCase
static::assertFalse($this->serviceWithSurveys->isExistingSurvey(4, true));
}
public function testGetStartSurveyUrlByToken()
{
$rpcClientManager = $this->getJsonRpcClientManager(0);
$sessionManager = $this->getSessionManager();
$this->createServiceWithoutSurveys($rpcClientManager, $sessionManager);
$this->createServiceWithSurveys($rpcClientManager, $sessionManager);
$surveyId = 123;
$token = uniqid();
$expectedUrl = sprintf('%s/%d?token=%s', $this->connectionBaseUrl, $surveyId, $token);
static::assertEquals($expectedUrl, $this->serviceWithoutSurveys->getStartSurveyUrlByToken($surveyId, $token));
static::assertEquals($expectedUrl, $this->serviceWithSurveys->getStartSurveyUrlByToken($surveyId, $token));
}
public function testGetStartSurveyUrl()
{
$rpcClientManager = $this->getJsonRpcClientManager(0);