CRM-20847 Support custom api with composite primary keys
authoreileen <emcnaughton@wikimedia.org>
Tue, 4 Jul 2017 03:05:15 +0000 (15:05 +1200)
committereileen <emcnaughton@wikimedia.org>
Tue, 11 Jul 2017 02:13:00 +0000 (14:13 +1200)
commit523c222f1c90e39ec67820636d4e1c2ead8a2835
treefb76edfccd2fdce0d58389233d1c445e34311ffc
parent7bfe1d0dda114b76e3db5dce4c025fb3430e3bb7
CRM-20847 Support custom api with composite primary keys

Do not add id if the field does not exist and add unit tests.

This adds a couple of checks in the api to not add the id field
Note that Grant is an example of an api which uses a uniqueName on
id & I checked manually that is still returned. SyntaxConformance
tests cover this a lot, but I still also added one check to the grant test.
Civi/API/SelectQuery.php
api/v3/utils.php
tests/phpunit/api/v3/CustomApiTest.php [new file with mode: 0644]
tests/phpunit/api/v3/GrantTest.php
tests/phpunit/api/v3/custom_api/MailingProviderData.php [new file with mode: 0644]