Unit tests - Update for api4 in core
authorTim Otten <totten@civicrm.org>
Sat, 19 Oct 2019 02:29:44 +0000 (19:29 -0700)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
ext/afform/core/tests/phpunit/CRM/Afform/UtilTest.php
ext/afform/mock/tests/phpunit/api/v4/AfformTestCase.php

index 288141f8d6a96a473e82f7789686bb141f0f2125..d7e9629908f2b228c7fb8dcdc4782be6a4f8ba86 100644 (file)
@@ -18,7 +18,7 @@ class CRM_Afform_UtilTest extends \PHPUnit\Framework\TestCase implements Headles
   public function setUpHeadless() {
     return \Civi\Test::headless()
       ->installMe(__DIR__)
-      ->install(['org.civicrm.api4'])
+      ->install(version_compare(CRM_Utils_System::version(), '5.19', '<') ? ['org.civicrm.api4'] : [])
       ->apply();
   }
 
index 6d3e9907af9360fe4b7b400dd3bc606edcfc0bc1..9df221ba69d6ab42cedf57427085c4d6eca5fd35 100644 (file)
@@ -14,7 +14,8 @@ abstract class api_v4_AfformTestCase extends \PHPUnit\Framework\TestCase impleme
    */
   public function setUpHeadless() {
     return \Civi\Test::headless()
-      ->install(['org.civicrm.api4', 'org.civicrm.afform', 'org.civicrm.afform-mock'])
+      ->install(version_compare(CRM_Utils_System::version(), '5.19', '<') ? ['org.civicrm.api4'] : [])
+      ->install(['org.civicrm.afform', 'org.civicrm.afform-mock'])
       ->apply();
   }