Exemplo n.º 1
0
 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"));
 }
Exemplo n.º 2
0
 public function testSetWithNoKey()
 {
     $config = new Config();
     $this->setExpectedException("SugiPHP\\Config\\Exception");
     $config->set(null, 1);
 }