From d98930a4e82944890f90a28ef0ac5e21934b6af3 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 5 Sep 2018 11:49:10 -0600 Subject: [PATCH] Trying to get tests to pass - Try using an intermediate variable --- admin/tests/PreferencesCommandTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/tests/PreferencesCommandTest.php b/admin/tests/PreferencesCommandTest.php index 4e537ae79c..6abec59e97 100644 --- a/admin/tests/PreferencesCommandTest.php +++ b/admin/tests/PreferencesCommandTest.php @@ -74,14 +74,15 @@ class PreferencesCommandTest extends CommandBase // At type level // DEBUG echo "\n\n". __METHOD__ . "($type) after:\n"; - $post_app = $post_pref->$type; + // Get type as an array since direct sub-access doesn't work in 5.6 + $post_app = $post_pref->$type; echo implode(', ',array_keys($post_pref->$type))."\n"; print_r($post_pref->$type[static::APP]); echo "Does '".static::APP."' have the key? " . (array_key_exists($this->preference_name, $post_pref->$type[static::APP]) ? 'Yes' : 'No') . "\n"; echo "Does post_app have the key? " . (array_key_exists($this->preference_name, $post_app[static::APP]) ? 'Yes' : 'No') . "\n"; - $this->assertArrayHasKey($this->preference_name, $post_pref->$type[static::APP], + $this->assertArrayHasKey($this->preference_name, $post_app[static::APP], "$type preferences does not have {$this->preference_name}"); - $this->assertEquals($set[$this->preference_name], $post_pref->$type[static::APP][$this->preference_name]); + $this->assertEquals($set[$this->preference_name], $post_app[static::APP][$this->preference_name]); $this->assertGreaterThan($log_count, $this->get_log_count(), "Command ($command) did not log"); }