}
/**
- * Assert that two numbers are approximately equal
+ * Assert that two numbers are approximately equal.
*
* @param int|float $expected
* @param int|float $actual
}
/**
+ * Assert attributes are equal.
+ *
* @param $expectedValues
* @param $actualValues
- * @param null $message
+ * @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
}
/**
- * Check that api returned 'is_error' => 0
- * else provide full message
+ * Check that api returned 'is_error' => 0.
+ *
* @param array $apiResult
* Api result.
* @param string $prefix
}
/**
- * Check that api returned 'is_error' => 1
- * else provide full message
+ * Check that api returned 'is_error' => 1.
*
* @param array $apiResult
* Api result.
}
/**
- * Check that a deleted item has been deleted
+ * Check that a deleted item has been deleted.
+ *
* @param $entity
* @param $id
*/
/**
* Create test generated example in api/v3/examples.
+ *
* To turn this off (e.g. on the server) set
* define(DONT_DOCUMENT_TEST_CONFIG ,1);
* in your settings file
+ *
* @param array $params
* Array as passed to civicrm_api function.
* @param array $result
public $DBResetRequired = TRUE;
+ /**
+ * @var int
+ */
+ protected $priceFieldID;
+
+ /**
+ * Setup function.
+ */
public function setUp() {
parent::setUp();
- // put stuff here that should happen before all tests in this unit
- $priceSetparams = array(
- # [domain_id] =>
+ // Put stuff here that should happen before all tests in this unit.
+ $priceSetParams = array(
'name' => 'default_goat_priceset',
- 'title' => 'Goat accomodation',
+ 'title' => 'Goat accommodation',
'is_active' => 1,
'help_pre' => "Where does your goat sleep",
'help_post' => "thank you for your time",
'is_reserved' => 1,
);
- $price_set = $this->callAPISuccess('price_set', 'create', $priceSetparams);
+ $price_set = $this->callAPISuccess('price_set', 'create', $priceSetParams);
$this->priceSetID = $price_set['id'];
- $priceFieldparams = array(
+ $priceFieldParams = array(
'price_set_id' => $this->priceSetID,
'name' => 'grassvariety',
'label' => 'Grass Variety',
'is_enter_qty' => 1,
'is_active' => 1,
);
- $priceField = $this->callAPISuccess('price_field', 'create', $priceFieldparams);
+ $priceField = $this->callAPISuccess('price_field', 'create', $priceFieldParams);
$this->priceFieldID = $priceField['id'];
$this->_params = array(
'price_field_id' => $this->priceFieldID,
- 'name' => 'ryegrass',
+ 'name' => 'rye grass',
'label' => 'juicy and healthy',
'amount' => 1,
);
$membershipOrgId = $this->organizationCreate(NULL);
$this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $membershipOrgId));
- $priceSetparams1 = array(
+ $priceSetParams1 = array(
'name' => 'priceset',
'title' => 'Priceset with Multiple Terms',
'is_active' => 1,
'is_quick_config' => 1,
'is_reserved' => 1,
);
- $price_set1 = $this->callAPISuccess('price_set', 'create', $priceSetparams1);
+ $price_set1 = $this->callAPISuccess('price_set', 'create', $priceSetParams1);
$this->priceSetID1 = $price_set1['id'];
- $priceFieldparams1 = array(
+ $priceFieldParams1 = array(
'price_set_id' => $this->priceSetID1,
'name' => 'memtype',
'label' => 'memtype',
'is_enter_qty' => 1,
'is_active' => 1,
);
- $priceField1 = $this->callAPISuccess('price_field', 'create', $priceFieldparams1);
+ $priceField1 = $this->callAPISuccess('price_field', 'create', $priceFieldParams1);
$this->priceFieldID1 = $priceField1['id'];
}
+ /**
+ * Tear down function.
+ *
+ * @throws \Exception
+ */
public function tearDown() {
$tablesToTruncate = array(
'civicrm_contact',