Total Lines | 19 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function test_get_using_custom_reader(): void |
||
35 | { |
||
36 | Config::getInstance()->setGlobalServices([ |
||
37 | 'config-readers' => [ |
||
38 | Config\GacelaFileConfig\GacelaConfigItem::DEFAULT_TYPE => new class () implements ConfigReaderInterface { |
||
39 | public function read(string $absolutePath): array |
||
40 | { |
||
41 | return ['key' => 'value']; |
||
42 | } |
||
43 | |||
44 | public function canRead(string $absolutePath): bool |
||
45 | { |
||
46 | return true; |
||
47 | } |
||
48 | }, |
||
49 | ], |
||
50 | ]); |
||
51 | |||
52 | self::assertSame('value', Config::getInstance()->get('key')); |
||
53 | } |
||
55 |