Ejemplo n.º 1
0
 public function test_case_insensitive()
 {
     $headers = new HttpHeaders();
     $headers->set('FOO', 'bar');
     $this->assertTrue($headers->has('fOO'));
     $this->assertEquals('bar', $headers->find('fOO'));
     $this->assertEquals(['foo' => 'bar'], $headers->toDistinctArray());
 }
Ejemplo n.º 2
0
 public function test_extract_auth_headers()
 {
     $parser = new ReceivedHeadersParser();
     $headers = new HttpHeaders();
     $this->assertFalse($headers->has('authorization'));
     $parser->extractAuthHeaders($headers, ['HTTP_AUTHORIZATION' => 'Bearer foo']);
     $this->assertEquals('Bearer foo', $headers->find('authorization'));
     $parser->extractAuthHeaders($headers, ['HTTP_AUTHORIZATION' => 'Bearer bar']);
     $this->assertEquals('Bearer foo', $headers->find('authorization'));
 }