Ejemplo n.º 1
0
 public function testPrependPush()
 {
     $cfg = new Config([]);
     $cfg->prepend('prepend', 'value');
     // non-existing key
     $this->assertSame($cfg->get('prepend')[0], 'value');
     $cfg->prepend('prepend', 'other Value');
     $this->assertSame(count($cfg->get('prepend')), 2);
     $this->assertSame($cfg->get('prepend')[0], 'other Value');
     // push a value onto the end
     $cfg->push('prepend', 'last value');
     $this->assertSame(count($cfg->get('prepend')), 3);
     $this->assertSame($cfg->get('prepend')[0], 'other Value');
 }
Ejemplo n.º 2
0
 public function testLoadData()
 {
     $storage = new File($this->sampleFile);
     $cfg = new Config($storage);
     $this->assertSame($cfg->get('foo.bar.something'), 'something');
 }