mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 00:25:35 +08:00
add more test cases
This commit is contained in:
@@ -85,9 +85,23 @@ class RefactoredConfigTest extends TestCase
|
|||||||
$this->assertTrue(self::$config->get('test.boolean'));
|
$this->assertTrue(self::$config->get('test.boolean'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetValue(): void
|
/**
|
||||||
|
* @dataProvider providerTestGetValue
|
||||||
|
*/
|
||||||
|
public function testGetValue(string $key, $expected): void
|
||||||
{
|
{
|
||||||
$this->assertSame('bar', self::$config->get('test.foo'));
|
$this->assertSame($expected, self::$config->get($key));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function providerTestGetValue(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'null' => ['test.null', null],
|
||||||
|
'boolean' => ['test.boolean', true],
|
||||||
|
'associate' => ['test.associate', ['x' => 'xxx', 'y' => 'yyy']],
|
||||||
|
'array' => ['test.array', ['aaa', 'zzz']],
|
||||||
|
'dot access' => ['test.x.z', 'zoo'],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetWithDefault(): void
|
public function testGetWithDefault(): void
|
||||||
|
|||||||
Reference in New Issue
Block a user