unset($params['is_primary']);
$params['id'] = $result['id'];
$this->callAPISuccess('Address', 'create', $params);
- $result = $this->callAPISuccess('Address', 'get', ['contact_id' => $params['contact_id']]);
+ $result = $this->callAPISuccess('Address', 'get', ['contact_id' => $params['contact_id'], 'return' => 'is_primary']);
$this->assertEquals(1, $result['count']);
$this->assertEquals(1, $result['values'][$result['id']]['is_primary']);
$this->getAndCheck($params, $result['id'], 'address');
$params = [
'contact_id' => $this->_contactID,
'street_name' => $address['values'][$address['id']]['street_name'],
+ 'return' => ['location_type_id', 'is_primary', 'street_address'],
];
$result = $this->callAPIAndDocument('Address', 'Get', $params, __FUNCTION__, __FILE__);
- $this->callAPISuccess('Address', 'delete', ['id' => $result['id']]);
$this->assertEquals($address['values'][$address['id']]['location_type_id'], $result['values'][$address['id']]['location_type_id']);
$this->assertEquals($address['values'][$address['id']]['is_primary'], $result['values'][$address['id']]['is_primary']);
$this->assertEquals($address['values'][$address['id']]['street_address'], $result['values'][$address['id']]['street_address']);
$this->callAPISuccess('address', 'create', $this->_params);
$params = [
'contact_id' => $this->_contactID,
+ 'return' => 'location_type_id',
];
- $address = $this->callAPISuccess('Address', 'getsingle', ($params));
+ $address = $this->callAPISuccessGetSingle('Address', ($params));
$this->assertEquals($address['location_type_id'], $this->_params['location_type_id']);
- $this->callAPISuccess('address', 'delete', ['id' => $address['id']]);
}
/**
$create = $this->callAPISuccess('address', 'create', $this->_params);
$this->callAPISuccess('address', 'create', array_merge($this->_params, ['street_address' => 'yzy']));
$subfile = "AddressSort";
- $description = "Demonstrates Use of sort filter.";
+ $description = 'Demonstrates Use of sort filter.';
$params = [
'options' => [
'sort' => 'street_address DESC',
'limit' => 2,
],
'sequential' => 1,
+ 'return' => 'street_address',
];
$result = $this->callAPIAndDocument('Address', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals(2, $result['count']);
$this->assertEquals('Ambachtstraat 23', $result['values'][1]['street_address']);
- $this->callAPISuccess('address', 'delete', ['id' => $create['id']]);
}
/**
public function testGetAddressLikeSuccess($version) {
$this->_apiversion = $version;
$this->callAPISuccess('address', 'create', $this->_params);
- $subfile = "AddressLike";
- $description = "Demonstrates Use of Like.";
+ $subfile = 'AddressLike';
+ $description = 'Demonstrates Use of Like.';
$params = [
'street_address' => ['LIKE' => '%mb%'],
'sequential' => 1,
+ 'return' => 'street_address',
];
$result = $this->callAPIAndDocument('Address', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals(1, $result['count']);
$this->assertEquals('Ambachtstraat 23', $result['values'][0]['street_address']);
- $this->callAPISuccess('address', 'delete', ['id' => $result['id']]);
}
/**
*/
public function testGetAddressLikeFail($version) {
$this->_apiversion = $version;
- $create = $this->callAPISuccess('address', 'create', $this->_params);
+ $this->callAPISuccess('address', 'create', $this->_params);
$params = [
'street_address' => ['LIKE' => "'%xy%'"],
'sequential' => 1,
];
- $result = $this->callAPISuccess('Address', 'Get', ($params));
+ $result = $this->callAPISuccessGetCount('Address', $params, 0);
$this->assertEquals(0, $result['count']);
- $this->callAPISuccess('address', 'delete', ['id' => $create['id']]);
}
/**
$this->customFieldDelete($ids['custom_field_id']);
$this->customGroupDelete($ids['custom_group_id']);
- $this->callAPISuccess('address', 'delete', ['id' => $result['id']]);
}
/**
public function testGetOptionsAbbr() {
$result = $this->callAPISuccess('Address', 'getoptions', [
'field' => 'country_id',
- 'context' => "abbreviate",
+ 'context' => 'abbreviate',
]);
$this->assertContains('US', $result['values']);
$this->assertNotContains('United States', $result['values']);
$result = $this->callAPISuccess('Address', 'getoptions', [
'field' => 'state_province_id',
- 'context' => "abbreviate",
+ 'context' => 'abbreviate',
]);
$this->assertContains('AL', $result['values']);
$this->assertNotContains('Alabama', $result['values']);