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');
 }