From 93bc1220860b6430593cd8d83f88bcfb983fb141 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Fri, 19 Jul 2024 08:18:10 +0200 Subject: [PATCH] apply StyleCI recommendation --- tst/ConfigurationTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tst/ConfigurationTest.php b/tst/ConfigurationTest.php index 317c9dc9..d3e87387 100644 --- a/tst/ConfigurationTest.php +++ b/tst/ConfigurationTest.php @@ -120,14 +120,15 @@ class ConfigurationTest extends TestCase unset($options['expire_options']['1week']); unset($options['expire_options']['1year']); unset($options['expire_options']['never']); - $valid_sri = $options['sri'][array_key_first($options['sri'])]; - $options['sri'][array_key_first($options['sri'])] = ''; // empty string should get replaced with default + $sri_key = array_key_first($options['sri']); + $valid_sri = $options['sri'][$sri_key]; + $options['sri'][$sri_key] = ''; // empty string should get replaced with default $options['sri']['js/example.js'] = 'some invalid SRI hash'; Helper::createIniFile(CONF, $options); $conf = new Configuration; // restore expected results $options['expire']['default'] = '5min'; - $options['sri'][array_key_first($options['sri'])] = $valid_sri; + $options['sri'][$sri_key] = $valid_sri; $this->assertEquals($options, $conf->get(), 'not overriding "missing" subkeys'); }