示例#1
0
文件: DbTest.php 项目: sugiphp/config
 public function testOneTable()
 {
     $config = new Config(new Db1Loader());
     $this->assertNull($config->get("nosuchkey"));
     $this->assertNull($config->get("nosuchkey.foo"));
     $this->assertEquals(array("host" => "localhost", "debug" => 1), $config->get("development"));
     $this->assertEquals(array("host" => "example.com", "debug" => null), $config->get("production"));
     $this->assertSame("example.com", $config->get("production.host"));
     $this->assertSame(0, $config->get("production.debug", 0));
     $this->assertNull($config->get("production.foo"));
 }
示例#2
0
 public function testSetWithConfigFileOverridingValue()
 {
     $locator = new FileLocator(__DIR__ . "/config");
     $loader = new NativeLoader($locator);
     $config = new Config($loader);
     $config->set("test.int", 7);
     $this->assertSame(7, $config->get("test.int"));
 }