Merge pull request #17294 from agh1/sr-rel-perms
[civicrm-core.git] / tests / phpunit / api / v3 / SurveyRespondantTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * Class api_v3_SurveyRespondantTest
14 * @group headless
15 */
16 class api_v3_SurveyRespondantTest extends CiviUnitTestCase {
17 protected $_apiversion = 3;
18 protected $params;
19
20 public function setUp() {
21 parent::setUp();
22 $this->useTransaction(TRUE);
23 $phoneBankActivity = $this->callAPISuccess('Option_value', 'Get', ['label' => 'PhoneBank', 'sequential' => 1]);
24 $phoneBankActivityTypeID = $phoneBankActivity['values'][0]['value'];
25 $surveyParams = [
26 'title' => "survey respondent",
27 'activity_type_id' => $phoneBankActivityTypeID,
28 'instructions' => "Call people, ask for money",
29 ];
30 $survey = $this->callAPISuccess('survey', 'create', $surveyParams);
31 $surveyID = $survey['id'];
32 $this->params = [
33 'sequential' => '1',
34 'survey_id' => $surveyID,
35 ];
36 }
37
38 /**
39 * Test survey respondent get.
40 */
41 public function testGetSurveyRespondants() {
42 $result = $this->callAPIAndDocument("SurveyRespondant", "get", $this->params, __FUNCTION__, __FILE__);
43 }
44
45 }