- // Create new profile having group_type: Contact,Individual
- $op = new PHPUnit_Extensions_Database_Operation_Insert();
- $op->execute($this->_dbconn,
- new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
- dirname(__FILE__) . "/dataset/uf_group_25.xml"
- )
- );
- // Create Contact + Idividual fields for profile
- $op = new PHPUnit_Extensions_Database_Operation_Insert();
- $op->execute($this->_dbconn,
- new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
- dirname(__FILE__) . "/dataset/uf_field_uf_group_25.xml"
- )
+
+ // 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'
+ ),
+ ),