* <http://www.gnu.org/licenses/>.
*/
-/**
- * Include class definitions
- */
-require_once 'CiviTest/CiviUnitTestCase.php';
-
/**
* Test APIv3 civicrm_activity_* functions
*
* @package CiviCRM_APIv3
* @subpackage API_Constant
+ * @group headless
*/
class api_v3_ConstantTest extends CiviUnitTestCase {
protected $_apiversion = 3;
/**
- * Test setup for every test
+ * Test setup for every test.
*
- * Connect to the database, truncate the tables that will be used
- * and redirect stdin to a temporary file
+ * Connect to the database, truncate the tables that will be used
+ * and redirect stdin to a temporary file
*/
public function setUp() {
// Connect to the database
}
/**
- * Test civicrm_constant_get( ) for unknown constant
+ * Test civicrm_constant_get( ) for unknown constant
*/
public function testUnknownConstant() {
$result = $this->callAPIFailure('constant', 'get', array(
}
/**
- * Test civicrm_constant_get( 'activityStatus' )
+ * Test civicrm_constant_get( 'activityStatus' )
*/
public function testActivityStatus() {
}
/**
- * Test civicrm_constant_get( 'activityType' )
+ * Test civicrm_constant_get( 'activityType' )
*/
public function testActivityType() {
-
- $parameters = array(TRUE, FALSE, TRUE);
-
- $result = $this->callAPISuccess('constant', 'get', array(
+ $result = $this->callAPIAndDocument('constant', 'get', array(
'name' => 'activityType',
- ));
+ ), __FUNCTION__, __FILE__, NULL, NULL, 'get');
$this->assertTrue($result['count'] > 2, "In line " . __LINE__);
$this->assertContains('Meeting', $result['values'], "In line " . __LINE__);
}
/**
- * Test civicrm_address_getoptions( 'location_type_id' )
+ * Test civicrm_address_getoptions( 'location_type_id' )
*/
public function testLocationTypeGet() {
// needed to get rid of cached values from previous tests
}
/**
- * Test civicrm_phone_getoptions( 'phone_type_id' )
+ * Test civicrm_phone_getoptions( 'phone_type_id' )
*/
public function testPhoneType() {
$params = array(
'field' => 'phone_type_id',
);
- $result = $this->callAPISuccess('phone', 'getoptions', $params);
+ $result = $this->callAPIAndDocument('phone', 'getoptions', $params, __FUNCTION__, __FILE__);
$this->assertEquals(5, $result['count'], "In line " . __LINE__);
$this->assertContains('Phone', $result['values'], "In line " . __LINE__);
}
/**
- * Test civicrm_constant_get( 'mailProtocol' )
+ * Test civicrm_constant_get( 'mailProtocol' )
*/
public function testmailProtocol() {
$params = array(
'field' => 'protocol',
);
- $result = $this->callAPISuccess('mail_settings', 'getoptions', $params);
+ $result = $this->callAPIAndDocument('mail_settings', 'getoptions', $params, __FUNCTION__, __FILE__);
$this->assertEquals(4, $result['count'], "In line " . __LINE__);
$this->assertContains('IMAP', $result['values'], "In line " . __LINE__);