| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class ConfigTest extends TestCase |
||
| 12 | { |
||
| 13 | private Config $config; |
||
| 14 | |||
| 15 | public function setUp(): void |
||
| 16 | { |
||
| 17 | Config::resetInstance(); |
||
| 18 | $this->config = Config::getInstance(); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function tearDown(): void |
||
| 22 | { |
||
| 23 | Config::resetInstance(); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function test_get_undefined_key(): void |
||
| 27 | { |
||
| 28 | $this->expectExceptionMessageMatches('/Could not find config key "key"/'); |
||
| 29 | $this->config->get('key'); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function test_get_default_value_from_undefined_key(): void |
||
| 35 | } |
||
| 36 | |||
| 37 | public function test_get_using_custom_reader(): void |
||
| 38 | { |
||
| 39 | $this->config->setConfigReaders([ |
||
| 40 | Config\GacelaJsonConfigItem::DEFAULT_TYPE => new class() implements ConfigReaderInterface { |
||
| 41 | public function read(string $absolutePath): array |
||
| 44 | } |
||
| 45 | |||
| 56 | } |
||
| 57 | } |
||
| 58 |