Updated Project Source code (I don't remember what i did.)
This commit is contained in:
parent
fc2e4d5a73
commit
4879fdf36d
10 changed files with 289 additions and 10 deletions
38
tests/Socialbox/Classes/ConfigurationTest.php
Normal file
38
tests/Socialbox/Classes/ConfigurationTest.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace Socialbox\Classes;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Socialbox's Configuration Test Class
|
||||
*
|
||||
* This is a test suite for testing the "getConfiguration" method in the "Configuration" class.
|
||||
*/
|
||||
class ConfigurationTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test the "getConfiguration" method in "Configuration" class.
|
||||
*/
|
||||
public function testGetConfiguration(): void
|
||||
{
|
||||
$config = Configuration::getConfiguration();
|
||||
$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('database.port', $config);
|
||||
$this->assertEquals($config['database.port'], 3306);
|
||||
|
||||
$this->assertArrayHasKey('database.username', $config);
|
||||
$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('database.name', $config);
|
||||
$this->assertEquals($config['database.name'], 'test');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue