Ejemplo n.º 1
0
 function testAddHeaders()
 {
     $message = new MessageMock();
     $message->addHeaders(['a' => 'b']);
     $message->addHeaders(['c' => 'd']);
     $this->assertEquals('b', $message->getHeader('a'));
 }
Ejemplo n.º 2
0
 function testAddHeaders()
 {
     $message = new MessageMock();
     $headers = ['X-Foo' => ['1'], 'X-Bar' => ['2']];
     $message->addHeaders($headers);
     $this->assertEquals($headers, $message->getHeaders());
     $message->addHeaders(['X-Foo' => ['3', '4'], 'X-Bar' => '5']);
     $expected = ['X-Foo' => ['1', '3', '4'], 'X-Bar' => ['2', '5']];
     $this->assertEquals($expected, $message->getHeaders());
 }