* @group headless
*/
class api_v3_CountryTest extends CiviUnitTestCase {
- protected $_apiversion;
protected $_params;
public function setUp() {
- $this->_apiversion = 3;
parent::setUp();
$this->useTransaction(TRUE);
$this->_params = [
];
}
+ /**
+ * @dataProvider versionThreeAndFour
+ */
public function testCreateCountry() {
$result = $this->callAPIAndDocument('country', 'create', $this->_params, __FUNCTION__, __FILE__);
$this->callAPISuccess('country', 'delete', ['id' => $result['id']]);
}
+ /**
+ * @dataProvider versionThreeAndFour
+ */
public function testDeleteCountry() {
//create one
$create = $this->callAPISuccess('country', 'create', $this->_params);
/**
* Test civicrm_phone_get with empty params.
+ * @dataProvider versionThreeAndFour
*/
public function testGetEmptyParams() {
$result = $this->callAPISuccess('Country', 'Get', []);
/**
* Test civicrm_phone_get with wrong params.
+ * @dataProvider versionThreeAndFour
*/
public function testGetWrongParams() {
$this->callAPIFailure('Country', 'Get', ['id' => 'abc']);
/**
* Test civicrm_phone_get - success expected.
+ * @dataProvider versionThreeAndFour
*/
public function testGet() {
$country = $this->callAPISuccess('Country', 'create', $this->_params);
/**
* If a new country is created and it is created again it should not create a second one.
* We check on the iso code (there should be only one iso code
+ * @dataProvider versionThreeAndFour
*/
public function testCreateDuplicateFail() {
$params = $this->_params;