<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
function tearDown() {}
public function testReportTemplate() {
- $result = civicrm_api('ReportTemplate', 'create', array(
- 'version' => $this->_apiversion,
+ $result = $this->callAPISuccess('ReportTemplate', 'create', array(
'label' => 'Example Form',
'description' => 'Longish description of the example form',
'class_name' => 'CRM_Report_Form_Examplez',
WHERE name = "CRM_Report_Form_Examplez"');
// change component to null
- $result = civicrm_api('ReportTemplate', 'create', array(
- 'version' => $this->_apiversion,
- 'id' => $entityId,
+ $result = $this->callAPISuccess('ReportTemplate', 'create', array( 'id' => $entityId,
'component' => '',
));
$this->assertAPISuccess($result);
AND component_id IS NULL');
// deactivate
- $result = civicrm_api('ReportTemplate', 'create', array(
- 'version' => $this->_apiversion,
- 'id' => $entityId,
+ $result = $this->callAPISuccess('ReportTemplate', 'create', array( 'id' => $entityId,
'is_active' => 0,
));
$this->assertAPISuccess($result);
WHERE name = "CRM_Report_Form_Examplez"');
// activate
- $result = civicrm_api('ReportTemplate', 'create', array(
- 'version' => $this->_apiversion,
- 'id' => $entityId,
+ $result = $this->callAPISuccess('ReportTemplate', 'create', array( 'id' => $entityId,
'is_active' => 1,
));
$this->assertAPISuccess($result);
$this->assertDBQuery(1, 'SELECT is_active FROM civicrm_option_value
WHERE name = "CRM_Report_Form_Examplez"');
- $result = civicrm_api('ReportTemplate', 'delete', array(
- 'version' => $this->_apiversion,
- 'id' => $entityId,
+ $result = $this->callAPISuccess('ReportTemplate', 'delete', array( 'id' => $entityId,
));
$this->assertAPISuccess($result);
$this->assertEquals(1, $result['count'], 'In line ' . __LINE__);