Ejemplo n.º 1
0
 public function testClearData()
 {
     $storage = new File($this->sampleWrite);
     $cfg = new Config($storage);
     $cfg->clear();
     $contents = file_get_contents($this->sampleWrite);
     $this->assertTrue($contents === '{}');
 }
Ejemplo n.º 2
0
 public function testAssocArray()
 {
     $cfg = new Config();
     $this->setExpectedException(InvalidArgumentException::class);
     $cfg->set('newkey', ['key' => 'value']);
 }
Ejemplo n.º 3
0
 public function testAll()
 {
     $cfg = new Config($this->data);
     $this->assertSame($cfg->all(), ['fooo' => 'bar', 'foo' => ['other' => 'bar', 'bar' => ['something' => 'something', 'list' => ['VALUE:foo.bar.list[0]', 'VALUE:foo.bar.list[1]', 'VALUE:foo.bar.list[2]']]]]);
 }