Use APIv4 when creating test entities
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 7 Jun 2023 20:06:51 +0000 (08:06 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 7 Jun 2023 20:06:51 +0000 (08:06 +1200)
tests/phpunit/CiviTest/CiviUnitTestCase.php

index 82a4451df827309d0072e160c8b4951577e99642..5e4756e3bb1be2e53e34c53c51e62244a8ba95e0 100644 (file)
@@ -569,6 +569,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase {
    * @return array|int
    */
   protected function createTestEntity(string $entity, array $params, string $identifier = 'default') {
+    $params['version'] = 4;
     $result = $this->callAPISuccess($entity, 'create', $params);
     $this->setTestEntityID($entity, $result['id'], $identifier);
     return reset($result['values']);