<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
class api_v3_CaseTypeTest extends CiviCaseTestCase {
- function setUp() {
+ public function setUp() {
$this->quickCleanup(array('civicrm_case_type'));
parent::setUp();
'caseRoles' => array(
array('name' => 'First role', 'creator' => 1, 'manager' => 1),
),
- )
+ ),
);
}
* This method is called after a test is executed.
*
*/
- function tearDown() {
+ public function tearDown() {
parent::tearDown();
$this->quickCleanup(array('civicrm_case_type'));
}
/**
- * check with empty array
+ * Check with empty array
*/
- function testCaseTypeCreateEmpty() {
+ public function testCaseTypeCreateEmpty() {
$this->callAPIFailure('CaseType', 'create', array());
}
/**
- * check if required fields are not passed
+ * Check if required fields are not passed
*/
- function testCaseTypeCreateWithoutRequired() {
+ public function testCaseTypeCreateWithoutRequired() {
$params = array(
'name' => 'this case should fail',
);
}
/**
- * test create methods with valid data
+ * Test create methods with valid data
* success expected
*/
- function testCaseTypeCreate() {
+ public function testCaseTypeCreate() {
// Create Case Type
$params = array(
'title' => 'Application',
/**
* Create a case with an invalid name
*/
- function testCaseTypeCreate_invalidName() {
+ public function testCaseTypeCreate_invalidName() {
// Create Case Type
$params = array(
'title' => 'Application',
/**
* Test update (create with id) function with valid parameters
*/
- function testCaseTypeUpdate() {
+ public function testCaseTypeUpdate() {
// Create Case Type
- $params = array(
+ $params = array(
'title' => 'Application',
'name' => 'Application',
'is_active' => 1,
/**
* Test delete function with valid parameters
*/
- function testCaseTypeDelete_New() {
+ public function testCaseTypeDelete_New() {
// Create Case Type
- $params = array(
+ $params = array(
'title' => 'Application',
'name' => 'Application',
'is_active' => 1,
}
/**
- * test create methods with xml file
+ * Test create methods with xml file
* success expected
*/
- function testCaseTypeCreateWithDefinition() {
+ public function testCaseTypeCreateWithDefinition() {
// Create Case Type
$params = $this->fixtures['Application_with_Definition'];
$result = $this->callAPISuccess('CaseType', 'create', $params);
/**
* Create a CaseType+case then delete the CaseType.
*/
- function testCaseTypeDelete_InUse() {
+ public function testCaseTypeDelete_InUse() {
// Create Case Type
$params = $this->fixtures['Application_with_Definition'];
$createCaseType = $this->callAPISuccess('CaseType', 'create', $params);
$this->assertEquals(0, $getCaseType['count']);
}
}
-