Skip to content

Commit

Permalink
Update test due to weird API change
Browse files Browse the repository at this point in the history
> http2: Whether HTTP/2 was used for the connection. Possible values are 0 (HTTP/2 was used) and 1 (HTTP/2 was not used).

See https://http2.pro/doc/api.
  • Loading branch information
kelunik committed Mar 21, 2024
1 parent 2b73a85 commit f607a33
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/ClientHttpBinIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,9 @@ public function testHttp2Support(): \Generator
$body = yield $response->getBody()->buffer();
$json = \json_decode($body, true);

$this->assertSame(1, $json['http2']);
$this->assertSame(0, $json['http2']);
$this->assertSame('HTTP/2.0', $json['protocol']);
$this->assertSame(1, $json['push']);
$this->assertSame(0, $json['push']);
$this->assertSame('2', $response->getProtocolVersion());
}

Expand All @@ -674,9 +674,9 @@ public function testHttp2SupportBody(): \Generator
$body = yield $response->getBody()->buffer();
$json = \json_decode($body, true);

$this->assertSame(1, $json['http2']);
$this->assertSame(0, $json['http2']);
$this->assertSame('HTTP/2.0', $json['protocol']);
$this->assertSame(1, $json['push']);
$this->assertSame(0, $json['push']);
$this->assertSame('2', $response->getProtocolVersion());
}

Expand All @@ -690,9 +690,9 @@ public function testHttp2SupportLargeBody(): \Generator
$body = yield $response->getBody()->buffer();
$json = \json_decode($body, true);

$this->assertSame(1, $json['http2']);
$this->assertSame(0, $json['http2']);
$this->assertSame('HTTP/2.0', $json['protocol']);
$this->assertSame(1, $json['push']);
$this->assertSame(0, $json['push']);
$this->assertSame('2', $response->getProtocolVersion());
}

Expand Down Expand Up @@ -730,8 +730,8 @@ public function testConcurrentSlowNetworkInterceptor(): \Generator
$json1 = \json_decode($body1, true);
$json2 = \json_decode($body2, true);

$this->assertSame(1, $json1['http2']);
$this->assertSame(1, $json2['http2']);
$this->assertSame(0, $json1['http2']);
$this->assertSame(0, $json2['http2']);
}

public function testHttp2UpgradeResponse(): \Generator
Expand Down

0 comments on commit f607a33

Please sign in to comment.