From b9ef583cb952dfed9330489edab59a2c01346685 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 9 Dec 2019 07:42:30 +1100 Subject: [PATCH] [NFC] Add in a unit test of passing an array into the Civi::settings set facade and getting it back --- tests/phpunit/Civi/Core/SettingsManagerTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/phpunit/Civi/Core/SettingsManagerTest.php b/tests/phpunit/Civi/Core/SettingsManagerTest.php index 640a968c21..71be2b80a7 100644 --- a/tests/phpunit/Civi/Core/SettingsManagerTest.php +++ b/tests/phpunit/Civi/Core/SettingsManagerTest.php @@ -143,4 +143,17 @@ class SettingsManagerTest extends \CiviUnitTestCase { return $manager; } + /** + * Test passing in an array to Civi::settings facade + */ + public function testArraySetting() { + $domain = \CRM_Core_DAO::createTestObject('CRM_Core_DAO_Domain'); + + $manager = $this->createManager()->useDefaults(); + $dSettings = $manager->getBagByDomain($domain->id); + $dSettings->set('test_setting', ['hello' => 'World']); + $test_setting = $dSettings->get('test_setting'); + $this->assertEquals(['hello' => 'World'], $test_setting); + } + } -- 2.25.1