/** * @covers Symfony\Components\HttpFoundation\ParameterBag::replace */ public function testReplace() { $bag = new ParameterBag(array('foo' => 'bar')); $bag->replace(array('FOO' => 'BAR')); $this->assertEquals(array('FOO' => 'BAR'), $bag->all(), '->replace() replaces the input with the argument'); $this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input'); }
protected function initializeHeaders() { $headers = array(); foreach ($this->server->all() as $key => $value) { if ('http_' === strtolower(substr($key, 0, 5))) { $headers[substr($key, 5)] = $value; } } return $headers; }