Skip to content

Commit

Permalink
Add test for client_max_window_bits without value
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Oct 21, 2023
1 parent 498bec7 commit 49e6e43
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/CompressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,20 @@ public function testFromServer(string $header): void
/**
* @dataProvider provideValidHeaders
*/
public function testFromClient(string $header): void
public function testFromClient(string $header): string
{
$compression = Rfc7692Compression::fromClientHeader($header, $out);
self::assertNotNull($out);
self::assertNotNull($compression);
$this->testCompression($compression);

return $out;
}

public function testClientHeaderWithoutValueForClientMaxWindowBits(): void
{
$out = $this->testFromClient('permessage-deflate; client_max_window_bits; client_no_context_takeover');
$this->assertStringContainsString('client_max_window_bits=15', $out);
}

private function testCompression(Rfc7692Compression $compression): void
Expand All @@ -63,7 +71,6 @@ public function provideInvalidHeaders(): iterable
'client_max_window_bits=16', // window too high
'client_max_window_bits=8', // window too low
'server_max_window_bits', // no value
'client_max_window_bits', // no value
],
)
];
Expand Down

0 comments on commit 49e6e43

Please sign in to comment.