From 1e98d6ef266d515e6a2518790b2aed99311bc439 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 8 Aug 2022 02:41:26 -0700 Subject: [PATCH] (dev/translation#78) TokenProcessorTest - Test with and without 'partial_locales' support --- tests/phpunit/Civi/Token/TokenProcessorTest.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/Civi/Token/TokenProcessorTest.php b/tests/phpunit/Civi/Token/TokenProcessorTest.php index 9829235ac4..c7394de808 100644 --- a/tests/phpunit/Civi/Token/TokenProcessorTest.php +++ b/tests/phpunit/Civi/Token/TokenProcessorTest.php @@ -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()); -- 2.25.1