diff --git a/tests/phpunit/api/v4/Service/TestCreationParameterProvider.php b/tests/phpunit/api/v4/Service/TestCreationParameterProvider.php index da96cec0c402..ee0138a946d7 100644 --- a/tests/phpunit/api/v4/Service/TestCreationParameterProvider.php +++ b/tests/phpunit/api/v4/Service/TestCreationParameterProvider.php @@ -53,6 +53,12 @@ public function getRequired($entity) { $requiredParams = []; foreach ($requiredFields as $requiredField) { $value = $this->getRequiredValue($requiredField); + if ($entity === 'UFField' && $requiredField->getName() === 'field_name') { + // This is a ruthless hack to avoid a unique constraint - but + // it's also a test class & hard to care enough to do something + // better + $value = 'activity_campaign_id'; + } $requiredParams[$requiredField->getName()] = $value; }