(dev/translation#78) TokenProcessorTest - Test with and without 'partial_locales...
authorTim Otten <totten@civicrm.org>
Mon, 8 Aug 2022 09:41:26 +0000 (02:41 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 29 Aug 2022 03:00:14 +0000 (20:00 -0700)
tests/phpunit/Civi/Token/TokenProcessorTest.php

index 9829235ac4ce7a092dab003c5f24daec7f32f662..c7394de808d764ca65e31f1bef32f33791cb910f 100644 (file)
@@ -177,10 +177,20 @@ class TokenProcessorTest extends \CiviUnitTestCase {
     }
   }
 
+  public function getPartialNonPartial(): array {
+    return [
+      'no-partial' => [['partial_locales' => FALSE]],
+      'yes-partial' => [['partial_locales' => TRUE]],
+    ];
+  }
+
   /**
    * @group locale
+   * @dataProvider getPartialNonPartial
+   * @param array $settings
    */
-  public function testRenderLocalizedSmarty() {
+  public function testRenderLocalizedSmarty(array $settings) {
+    $cleanup = \CRM_Utils_AutoClean::swapSettings($settings);
     \CRM_Utils_Time::setTime('2022-04-08 16:32:04');
     $resetTime = \CRM_Utils_AutoClean::with(['CRM_Utils_Time', 'resetTime']);
     $this->dispatcher->addSubscriber(new \CRM_Core_DomainTokens());