|
@@ 41-52 (lines=12) @@
|
| 38 |
|
$this->assertEmpty($config); |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
public function testApp() { |
| 42 |
|
$time = time(); |
| 43 |
|
Config::save('app', ['test' => $time]); |
| 44 |
|
$config = Config::app(false, true); |
| 45 |
|
$this->assertEquals(["test" => $time], $config); |
| 46 |
|
|
| 47 |
|
$config = Config::app(); |
| 48 |
|
$this->assertEquals(["test" => $time], $config); |
| 49 |
|
|
| 50 |
|
$config = Config::app(new \Inji\App(['path' => 'notExits'])); |
| 51 |
|
$this->assertEmpty($config); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
public function testShare() { |
| 55 |
|
$time = time(); |
|
@@ 76-88 (lines=13) @@
|
| 73 |
|
$this->assertEmpty($config); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function testModule() { |
| 77 |
|
$time = time(); |
| 78 |
|
Config::save('module', ['test' => $time], 'TestModule'); |
| 79 |
|
|
| 80 |
|
$config = Config::module('TestModule', null, true); |
| 81 |
|
$this->assertEquals(["test" => $time], $config); |
| 82 |
|
|
| 83 |
|
$config = Config::module('TestModule'); |
| 84 |
|
$this->assertEquals(["test" => $time], $config); |
| 85 |
|
|
| 86 |
|
$config = Config::module('notExist'); |
| 87 |
|
$this->assertEmpty($config); |
| 88 |
|
} |
| 89 |
|
} |