<?php
/*
+--------------------------------------------------------------------+
-| CiviCRM version 4.5 |
+| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
require_once 'CiviTest/CiviUnitTestCase.php';
+
+/**
+ * Class api_v3_CampaignTest
+ */
class api_v3_CampaignTest extends CiviUnitTestCase {
protected $_apiversion;
protected $params;
public $DBResetRequired = FALSE;
- function setUp() {
+ public function setUp() {
$this->_apiversion = 3;
$this->params = array(
'title' => "campaign title",
'created_date' => 'first sat of July 2008',
);
parent::setUp();
+ $this->useTransaction(TRUE);
}
- function tearDown() {}
-
public function testCreateCampaign() {
$description = "Create a campaign - Note use of relative dates here http://www.php.net/manual/en/datetime.formats.relative.php";
$result = $this->callAPIAndDocument('campaign', 'create', $this->params, __FUNCTION__, __FILE__, $description);
}
public function testDeleteCampaign() {
+ $this->callAPISuccess('campaign', 'create', $this->params);
$entity = $this->callAPISuccess('campaign', 'get', ($this->params));
$delete = array('id' => $entity['id']);
$result = $this->callAPIAndDocument('campaign', 'delete', $delete, __FUNCTION__, __FILE__);
$this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__);
}
}
-