Feature Set
Contact Sub type adds and extends a lot of functionality to CiviCRM. Details of the functionality added can be found on Jira and on the blog. We decided to write a few unit tests to test various aspects of the functionality. We also decided to take a clean slate approach and try to design and describe the tests before writing any test code. The folks writing the tests are different from the folks who wrote the code to allow a different set of eyes to look at the code.
Testing focus
We decided to narrow down our testing to a few core features. We will split up the work among 4 of us (Dave, Kurund, Yash and Lobo) and plan on spending between 2-4 complete days on this before the 3.1 alpha release
Data Generation Functions (Kurund/Lobo/DGG)
- Function to populate our default contact subtypes. We will use the same set of contact subtypes as the generated data
- Function to create 'n' contacts with different contact (sub)types. This could potentially use the dataset.xml method
- Function to create 'm' custom groups that extend different contact (sub)types
- Function to populate values for various contacts with regard to these custom groups
- Function to set relationship types between 2 contact (sub)types
- Function to create relationship(s) between contacts
Contact Sub Type (BAO Test) - Lobo
- Get list of current types and subtypes
- Create new subtype and ensure it is present in db with the right parent
- Delete a subtype and ensure it is not returned in the "get" function. Ensure there is a confirm page
- Get list of subtypes for a given contact type
Contact Creation and Update (api and BAO) - Yashodha
- Create a contact of each type and subtype
- Update the contact with no subtype to a valid subtype
- Update the contact with no subtype to an invalid subtype - ERROR
- Update the contact with a subtype with another subtype - ERROR
Search - Kurund
- Add various number of contacts for each type and subtype
- Search for each type and subtype and ensure they match
- Search for a combination of types/subtypes and ensure they match
Custom Value - Michal
- Add valid custom data to a contact of type X
- Add valid custom data to a contact of subtype X
- Use the api to add custom data to a contact in a custom group that does not belong to the contact - ERROR
- retrieve custom values for the first two cases
Relationship - Deepak
- Create relationship type(s) between various (sub)types
- Add a valid relationship between two contact(s)
- Ensure that you cannot add an invalid relationship type between two contact(s) (the type check should fail) - ERROR
