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