23 lines
604 B
PHP
23 lines
604 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use UploadLogger\Core\Config;
|
|
|
|
final class ConfigTest extends TestCase
|
|
{
|
|
public function testDotNotationGetters(): void
|
|
{
|
|
$data = [
|
|
'modules' => ['flood' => true],
|
|
'limits' => ['max_size' => 12345, 'nested' => ['x' => 5]],
|
|
];
|
|
|
|
$cfg = new Config($data);
|
|
|
|
$this->assertTrue($cfg->isModuleEnabled('flood'));
|
|
$this->assertEquals(12345, $cfg->get('limits.max_size'));
|
|
$this->assertEquals(5, $cfg->get('limits.nested.x'));
|
|
$this->assertNull($cfg->get('limits.nonexistent'));
|
|
}
|
|
}
|