-
Notifications
You must be signed in to change notification settings - Fork 1
/
MutableJsonConfigTest.php
43 lines (35 loc) · 1.04 KB
/
MutableJsonConfigTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
declare(strict_types=1);
namespace TutuRu\Tests\Config;
class MutableJsonConfigTest extends BaseTest
{
/**
* @dataProvider setValueDataProvider
*/
public function testSetValueWithMutableConfig($value)
{
$config = $this->createMutableJsonConfig(__DIR__ . '/config/app.json');
$config->setValue('name', $value);
$this->assertEquals($value, $config->getValue('name'));
}
/**
* @dataProvider setValueDataProvider
*/
public function testSetValueWithMutableConfigForNewNode($value)
{
$config = $this->createMutableJsonConfig(__DIR__ . '/config/app.json');
$config->setValue('new.node', $value);
$this->assertEquals($value, $config->getValue('new.node'));
$config->setValue('name.test', $value);
$this->assertEquals($value, $config->getValue('name.test'));
}
public function setValueDataProvider()
{
return [
[null],
['a'],
[['a', 'b']],
[['a' => 1, 'b' => 2]],
];
}
}