From ee051a355c98f35999938665ac4c2253913747ae Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 30 Nov 2022 14:10:24 +1300 Subject: [PATCH] Disable partial_locales in tests that are testing the legacy setting --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 47fba04949..21115e2c03 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -3261,7 +3261,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { * * @return array */ - public function getBooleanDataProvider() { + public function getBooleanDataProvider(): array { return [[TRUE], [FALSE]]; } @@ -3270,14 +3270,15 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { * * Note that this only covers some common scenarios. * - * It does not cater for a situation where the thousand separator is a [space] - * Latter is the Norwegian localization. At least some tests need to - * use setMonetaryDecimalPoint and setMonetaryThousandSeparator directly - * to provide broader coverage. + * Most notably it tests our legacy way of setting currency separators. + * + * It is now preferred to use the locale instead. This test disables partial_locales + * in order to test our legacy method. * * @param string $thousandSeparator */ protected function setCurrencySeparators(string $thousandSeparator): void { + Civi::settings()->set('partial_locales', FALSE); Civi::settings()->set('monetaryThousandSeparator', $thousandSeparator); Civi::settings()->set('monetaryDecimalPoint', ($thousandSeparator === ',' ? '.' : ',')); } -- 2.25.1