You are here

public function HeaderBagTest::testSetAssociativeArray in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/HeaderBagTest.php \Symfony\Component\HttpFoundation\Tests\HeaderBagTest::testSetAssociativeArray()

File

vendor/symfony/http-foundation/Tests/HeaderBagTest.php, line 114

Class

HeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testSetAssociativeArray() {
  $bag = new HeaderBag();
  $bag
    ->set('foo', array(
    'bad-assoc-index' => 'value',
  ));
  $this
    ->assertSame('value', $bag
    ->get('foo'));
  $this
    ->assertEquals(array(
    'value',
  ), $bag
    ->get('foo', 'nope', false), 'assoc indices of multi-valued headers are ignored');
}