From 624b1f45b6f24733f787ace1bfc32711c938d4a0 Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 24 Sep 2024 15:00:12 -0400 Subject: [PATCH] Refactor configuration test to use nested array keys. --- tests/Socialbox/Classes/ConfigurationTest.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/Socialbox/Classes/ConfigurationTest.php b/tests/Socialbox/Classes/ConfigurationTest.php index 459ddd9..3725c19 100644 --- a/tests/Socialbox/Classes/ConfigurationTest.php +++ b/tests/Socialbox/Classes/ConfigurationTest.php @@ -20,19 +20,19 @@ class ConfigurationTest extends TestCase $this->assertIsArray($config, "Configuration should be an array."); //Assert that all the default configuration exists - $this->assertArrayHasKey('database.host', $config); - $this->assertEquals($config['database.host'], '127.0.0.1'); + $this->assertArrayHasKey('host', $config['database']); + $this->assertEquals($config['database']['host'], '127.0.0.1'); - $this->assertArrayHasKey('database.port', $config); - $this->assertEquals($config['database.port'], 3306); + $this->assertArrayHasKey('port', $config['database']); + $this->assertEquals($config['database']['port'], 3306); - $this->assertArrayHasKey('database.username', $config); - $this->assertEquals($config['database.username'], 'root'); + $this->assertArrayHasKey('username', $config['database']); + $this->assertEquals($config['database']['username'], 'root'); - $this->assertArrayHasKey('database.password', $config); - $this->assertNull($config['database.password'], 'null should be the value of database.password.'); + $this->assertArrayHasKey('password', $config['database']); + $this->assertNull($config['database']['password'], 'null should be the value of database.password.'); - $this->assertArrayHasKey('database.name', $config); - $this->assertEquals($config['database.name'], 'test'); + $this->assertArrayHasKey('name', $config['database']); + $this->assertEquals($config['database']['name'], 'test'); } } \ No newline at end of file