+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
require_once 'CiviTest/CiviUnitTestCase.php';
/**
* Test APIv3 civicrm_survey_* functions
*
- * @package CiviCRM_APIv3
- * @subpackage API_Campaign
+ * @package CiviCRM_APIv3
+ * @subpackage API_Campaign
*/
require_once 'CiviTest/CiviUnitTestCase.php';
public function setUp() {
- $phoneBankActivityTypeID = $this->callAPISuccessGetValue('Option_value', array('label' => 'PhoneBank', 'return' => 'value'), 'integer');
+ $phoneBankActivityTypeID = $this->callAPISuccessGetValue('Option_value', array(
+ 'label' => 'PhoneBank',
+ 'return' => 'value',
+ ), 'integer');
$this->useTransaction();
$this->enableCiviCampaign();
$this->params = array(
}
/**
- * Test create function succeeds
+ * Test create function succeeds.
*/
public function testCreateSurvey() {
$result = $this->callAPIAndDocument('survey', 'create', $this->params, __FUNCTION__, __FILE__);
}
/**
- * Test get function succeeds (this is actually largely tested in the get
+ * Test get function succeeds.
+ *
+ * This is actually largely tested in the get
* action on create. Add extra checks for any 'special' return values or
* behaviours
- *
*/
public function testGetSurvey() {
$this->createTestEntity();
$this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__);
}
-/**
- * Check the delete function succeeds
- */
+ /**
+ * Check the delete function succeeds.
+ */
public function testDeleteSurvey() {
$entity = $this->createTestEntity();
$result = $this->callAPIAndDocument('survey', 'delete', array('id' => $entity['id']), __FUNCTION__, __FILE__);
- $checkDeleted = $this->callAPISuccess($this->entity, 'get', array(
- ));
+ $checkDeleted = $this->callAPISuccess($this->entity, 'get', array());
$this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__);
}
/**
- * Test & document chained delete pattern. Note that explanation of the pattern
- * is best put in the $description variable as it will then be displayed in the
- * test generated examples. (these are to be found in the api/examples folder)
+ * Test & document chained delete pattern.
*
+ * Note that explanation of the pattern
+ * is best put in the $description variable as it will then be displayed in the
+ * test generated examples. (these are to be found in the api/examples folder).
*/
public function testGetSurveyChainDelete() {
- $description = "demonstrates get + delete in the same call";
- $subfile = 'ChainedGetDelete';
- $params = array(
+ $description = "Demonstrates get + delete in the same call.";
+ $subfile = 'ChainedGetDelete';
+ $params = array(
'title' => "survey title",
'api.survey.delete' => 1,
);