From 9ca7d5daf984763ed46d87cb89714fe4b247f839 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Tue, 6 Sep 2016 11:12:02 -0400 Subject: [PATCH] CRM-19286 - add unit test to avoid future problems with surveys. --- tests/phpunit/api/v3/UFJoinTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index caa48e6411..8137d20661 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -156,6 +156,25 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { $this->assertEquals($ufJoinUpdated['values'][0]['is_active'], $params['is_active']); } + /** + * Ensure we can create a survey join which is less common than event or contribution + * joins. + */ + public function testCreateSurveyUFJoin() { + $params = array( + 'module' => 'CiviCampaign', + 'entity_table' => 'civicrm_survey', + 'entity_id' => 1, + 'weight' => 1, + 'uf_group_id' => $this->_ufGroupId, + 'is_active' => 1, + 'sequential' => 1, + ); + $ufJoin = $this->callAPIAndDocument('uf_join', 'create', $params, __FUNCTION__, __FILE__); + $this->assertEquals($ufJoin['values'][0]['module'], $params['module']); + $this->assertEquals($ufJoin['values'][0]['uf_group_id'], $params['uf_group_id']); + $this->assertEquals($ufJoin['values'][0]['is_active'], $params['is_active']); + } public function testFindUFJoinWrongParamsType() { $params = 'a string'; -- 2.25.1