aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/Lib/ConfigTest.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-22 08:37:29 +0000
committerMario <mario@mariovavti.com>2024-03-22 08:37:29 +0000
commit1aeb05628b6a2a069c46980efbe628362c9e3e74 (patch)
treee9aed15d0cd74e0c23dcb05c7be8fe9541efdf36 /tests/unit/Lib/ConfigTest.php
parent5b7387459cf4de8f7354d81cb0392c4225714d94 (diff)
parentb464fae3bf22585888c5f3def8eded76fd48ed16 (diff)
downloadvolse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.tar.gz
volse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.tar.bz2
volse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.zip
Merge branch '9.0RC'9.0
Diffstat (limited to 'tests/unit/Lib/ConfigTest.php')
-rw-r--r--tests/unit/Lib/ConfigTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/Lib/ConfigTest.php b/tests/unit/Lib/ConfigTest.php
index a8ae3631b..c853cdd87 100644
--- a/tests/unit/Lib/ConfigTest.php
+++ b/tests/unit/Lib/ConfigTest.php
@@ -20,6 +20,7 @@ class ConfigTest extends Zotlabs\Tests\Unit\UnitTestCase {
'php-array' => 'a:3:{i:0;s:3:"one";i:1;s:3:"two";i:2;s:5:"three";}',
'json-array' => 'json:["one","two","three"]',
'object-injection' => 'a:1:{i:0;O:18:"Zotlabs\Lib\Config":0:{}}',
+ 'unserialized-array' => ['one', 'two', 'three'],
'config_loaded' => true,
),
);
@@ -51,6 +52,17 @@ class ConfigTest extends Zotlabs\Tests\Unit\UnitTestCase {
}
/*
+ * Test that we can retreive unserialized arrays which are usually
+ * returned from the existing config cache.
+ */
+ public function testGetPHPUnserializedArray(): void {
+ $this->assertEquals(
+ Zotlabs\Lib\Config::Get('test', 'unserialized-array'),
+ array('one', 'two', 'three')
+ );
+ }
+
+ /*
* Make sure we're not vulnerable to PHP Object injection attacks when
* using the PHP `unserialize()` function.
*/