+ /**
+ * Create a profile
+ */
+ function _createIndividualProfile() {
+
+ // creating these via the api as we want to utilise & test the flushing of caches when fields created
+ // via the api
+
+ $ufGroupParams = array(
+ 'group_type' => 'Individual,Contact',// really we should remove this & test the ufField create sets it
+ 'name' => 'test_individual_contact_profile',
+ 'title' => 'Flat Coffee',
+ 'api.uf_field.create' => array(
+ array(
+ 'field_name' => 'first_name',
+ 'is_required' => 1,
+ 'visibility' => 'Public Pages and Listings',
+ 'field_type' => 'Individual',
+ 'label' => 'First Name',
+ ),
+ array(
+ 'field_name' => 'last_name',
+ 'is_required' => 1,
+ 'visibility' => 'Public Pages and Listings',
+ 'field_type' => 'Individual',
+ 'label' => 'Last Name',
+ ),
+ array(
+ 'field_name' => 'email',
+ 'is_required' => 1,
+ 'visibility' => 'Public Pages and Listings',
+ 'field_type' => 'Contact',
+ 'label' => 'Email',
+ ),
+ array(
+ 'field_name' => 'phone',
+ 'is_required' => 1,
+ 'visibility' => 'Public Pages and Listings',
+ 'field_type' => 'Contact',
+ 'location_type_id' => 1,
+ 'phone_type_id' => 1,
+ 'label' => 'Phone'
+ ),
+ array(
+ 'field_name' => 'country',
+ 'is_required' => 1,
+ 'visibility' => 'Public Pages and Listings',
+ 'field_type' => 'Contact',
+ 'location_type_id' => 1,
+ 'label' => 'Country'
+ ),
+ array(
+ 'field_name' => 'state_province',
+ 'is_required' => 1,
+ 'visibility' => 'Public Pages and Listings',
+ 'field_type' => 'Contact',
+ 'location_type_id' => 1,
+ 'label' => 'State Province'
+ ),
+ array(
+ 'field_name' => 'postal_code',
+ 'is_required' => 0,
+ 'field_type' => 'Contact',
+ 'location_type_id' => 1,
+ 'label' => 'State Province'
+ ),
+ ),
+ );
+ $profile = $this->callAPISuccess('uf_group', 'create', $ufGroupParams);
+ $this->_profileID = $profile['id'];
+ }
+
+ function _addCustomFieldToProfile($profileID) {
+ $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, '');
+ $this->uFFieldCreate(array('uf_group_id' => $profileID, 'field_name' => 'custom_' . $ids['custom_field_id'], 'contact_type' => 'Contact'));
+ }