Merge pull request #16469 from civicrm/5.22
[civicrm-core.git] / tests / phpunit / api / v3 / SurveyRespondantTest.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
7d61e75f 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
7d61e75f
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
6a488035
TO
9 +--------------------------------------------------------------------+
10 */
6a488035 11
e9479dcf
EM
12/**
13 * Class api_v3_SurveyRespondantTest
acb109b7 14 * @group headless
e9479dcf 15 */
6a488035 16class api_v3_SurveyRespondantTest extends CiviUnitTestCase {
6c6e6187 17 protected $_apiversion = 3;
6a488035 18 protected $params;
b7c9bc4c 19
00be9182 20 public function setUp() {
dd348dec
TO
21 parent::setUp();
22 $this->useTransaction(TRUE);
9099cab3 23 $phoneBankActivity = $this->callAPISuccess('Option_value', 'Get', ['label' => 'PhoneBank', 'sequential' => 1]);
6a488035 24 $phoneBankActivityTypeID = $phoneBankActivity['values'][0]['value'];
9099cab3 25 $surveyParams = [
6a488035
TO
26 'title' => "survey respondent",
27 'activity_type_id' => $phoneBankActivityTypeID,
28 'instructions' => "Call people, ask for money",
9099cab3 29 ];
7fbb4198 30 $survey = $this->callAPISuccess('survey', 'create', $surveyParams);
6a488035 31 $surveyID = $survey['id'];
9099cab3 32 $this->params = [
6c6e6187 33 'sequential' => '1',
21dfd5f5 34 'survey_id' => $surveyID,
9099cab3 35 ];
6a488035 36 }
b6708aeb 37
6a488035
TO
38 /**
39 * Test survey respondent get.
40 */
41 public function testGetSurveyRespondants() {
6c6e6187 42 $result = $this->callAPIAndDocument("SurveyRespondant", "get", $this->params, __FUNCTION__, __FILE__);
6a488035
TO
43 }
44
45}