| Total Complexity | 4 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class DefaultsTest extends BaseTest |
||
| 15 | { |
||
| 16 | public function testGetNonExistedByDefaultConfig(): void |
||
| 17 | { |
||
| 18 | $cf = $this->getFactory(); |
||
| 19 | $cf->setDefaults('magic', ['key' => 'value']); |
||
| 20 | |||
| 21 | $config = $cf->getConfig('magic'); |
||
| 22 | |||
| 23 | $this->assertEquals( |
||
| 24 | ['key' => 'value'], |
||
| 25 | $config |
||
| 26 | ); |
||
| 27 | |||
| 28 | $this->assertSame($config, $cf->getConfig('magic')); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @expectedException \Spiral\Core\Exception\ConfiguratorException |
||
| 33 | */ |
||
| 34 | public function testDefaultsTwice(): void |
||
| 35 | { |
||
| 36 | $cf = $this->getFactory(); |
||
| 37 | $cf->setDefaults('magic', ['key' => 'value']); |
||
| 38 | $cf->setDefaults('magic', ['key' => 'value']); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @expectedException \Spiral\Core\Exception\ConfiguratorException |
||
| 43 | */ |
||
| 44 | public function testDefaultToAlreadyLoaded(): void |
||
| 45 | { |
||
| 46 | $cf = $this->getFactory(); |
||
| 47 | |||
| 48 | $cf->getConfig('test'); |
||
| 49 | $cf->setDefaults('test', ['key' => 'value']); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function testOverwrite(): void |
||
| 72 | } |
||
| 73 | } |
||
| 74 |