phpunit --group SmartGroup -vvv --debug sites/default/files/civicrm/ext/uk.co.vedaconsulting.mailchimp/tests/integration/MailchimpApiIntegrationTest.php
PHPUnit 4.3.5 by Sebastian Bergmann.
Starting test 'MailchimpApiIntegrationTest::testSmartGroupSync'.
.
CiviCRM_API3_Exception: Could not delete group 277 in civicrm_api3() (line 45 of ~Sites/civicrm.dev/sites/all/modules/civicrm/api/api.php).
The corresponding group was definitely being created during the tests, but was not present to be deleted when tearDownCiviCrmFixtures was called. Adding code to get the group first before deletion should avoid this exception being triggered.
If I had to guess, I'd speculate that perhaps the group is being removed earlier in 4.7 as part of some earlier contact cleanup - for example, if the group was "owned" by one of the test contacts, and a delete for the group is triggered on contact delete.
I was running into this when running tests -
The corresponding group was definitely being created during the tests, but was not present to be deleted when
tearDownCiviCrmFixtures
was called. Adding code toget
the group first before deletion should avoid this exception being triggered.If I had to guess, I'd speculate that perhaps the group is being removed earlier in 4.7 as part of some earlier contact cleanup - for example, if the group was "owned" by one of the test contacts, and a delete for the group is triggered on contact delete.