[REF] Cleanup function for retrieving contact types.
authoreileen <emcnaughton@wikimedia.org>
Sun, 21 Jun 2020 00:08:04 +0000 (12:08 +1200)
committereileen <emcnaughton@wikimedia.org>
Sun, 21 Jun 2020 00:43:27 +0000 (12:43 +1200)
commitccd901a1f676f1c242d0a0058e2a88f9874c1eee
treeb92e1c7017ab234881df6e0254cca46335731fdf
parentc67d09e8bc2540a4e1a16019b8b4a2b3f16552f5
[REF] Cleanup function for retrieving contact types.

This switches to using the apiv4 as part of trying to eliminate calls to executeQuery where the DAO is passed in
like

```
       = CRM_Core_DAO::executeQuery(, [],
        FALSE, 'CRM_Contact_DAO_ContactType'
      );
```

Note that this file seems to be the only place this is done.

Also note that I added tests first & the changes to the test highlight what is changed in the PR in the output - namely
- stricter type casting (courtesy apiv4)
- same keys present for all types
CRM/Contact/BAO/ContactType.php
tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php