* @group headless
*/
class api_v3_StateProvinceTest extends CiviUnitTestCase {
- protected $_apiversion;
protected $_params;
public function setUp() {
- $this->_apiversion = 3;
parent::setUp();
$this->useTransaction(TRUE);
$this->_params = [
];
}
+ /**
+ * @dataProvider versionThreeAndFour
+ */
public function testCreateStateProvince() {
$result = $this->callAPIAndDocument('StateProvince', 'create', $this->_params, __FUNCTION__, __FILE__);
$this->assertEquals(1, $result['count']);
$this->callAPISuccess('StateProvince', 'delete', ['id' => $result['id']]);
}
+ /**
+ * @dataProvider versionThreeAndFour
+ */
public function testDeleteStateProvince() {
// Create
$create = $this->callAPISuccess('StateProvince', 'create', $this->_params);
/**
* Test with empty params
+ * @dataProvider versionThreeAndFour
*/
public function testGetEmptyParams() {
$result = $this->callAPISuccess('StateProvince', 'Get', []);
/**
* Test with wrong params
+ * @dataProvider versionThreeAndFour
*/
public function testGetWrongParams() {
$this->callAPIFailure('StateProvince', 'Get', ['id' => 'abc']);
/**
* Test get
+ * @dataProvider versionThreeAndFour
*/
public function testGet() {
$province = $this->callAPISuccess('StateProvince', 'create', $this->_params);
/**
* There cannot be two state/provinces with the same name in the same country.
+ * @dataProvider versionThreeAndFour
*/
public function testCreateDuplicateFail() {
$params = $this->_params;