Skip to content

Commit 00e6eb8

Browse files
committed
for hhvm4.58
1 parent f90adf6 commit 00e6eb8

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

.travis.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@ services:
44
- docker
55
env:
66
matrix:
7-
- HHVM_VERSION=4.41.0
8-
- HHVM_VERSION=4.42.0
9-
- HHVM_VERSION=4.43.0
10-
- HHVM_VERSION=4.44.0
11-
- HHVM_VERSION=4.45.0
12-
- HHVM_VERSION=4.46.0
13-
- HHVM_VERSION=4.47.0
14-
- HHVM_VERSION=4.48.0
15-
- HHVM_VERSION=4.49.0
16-
- HHVM_VERSION=4.50.0
7+
- HHVM_VERSION=4.58.1
178
- HHVM_VERSION=latest
189
install:
1910
- docker pull hhvm/hhvm:$HHVM_VERSION

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
],
2020
"require": {
21-
"hhvm": "^4.41",
21+
"hhvm": "^4.58",
2222
"hhvm/hsl": "^4.0",
2323
"hhvm/hsl-experimental": "^4.37",
2424
"hhvm/hhvm-autoload": "^3.0",
@@ -29,7 +29,7 @@
2929
"hhvm/hacktest": "^2.0",
3030
"facebook/fbexpect": "^2.7",
3131
"hhvm/hhast": "^4.0",
32-
"ytake/hungrr": "^0.10"
32+
"ytake/hungrr": "^0.12"
3333
},
3434
"autoload": {
3535
"psr-4": {

src/Emitter/SapiEmitter.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SapiEmitter implements EmitterInterface {
4646
private function emitBody(
4747
ReadHandle $readHandle,
4848
): void {
49-
echo $readHandle->rawReadBlocking();
49+
echo $readHandle->read();
5050
}
5151

5252
private async function emitBodyAsync(

tests/EmitterStackTest.hack

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use function ob_end_clean;
1010

1111
final class EmitterStackTest extends HackTest {
1212

13-
private ?EmitterStack $stack;
13+
<<__LateInit>> private EmitterStack $stack;
1414

1515
<<__Override>>
1616
public async function beforeEachTestAsync(): Awaitable<void> {
@@ -19,10 +19,11 @@ final class EmitterStackTest extends HackTest {
1919

2020
public function testShouldEmitTrue(): void {
2121
$sapiEmmiter = new SapiEmitter();
22-
$this->stack?->push($sapiEmmiter);
22+
$this->stack->push($sapiEmmiter);
2323
list($readHandle, $writeHandle) = IO\pipe_nd();
24+
$writeHandle->write('testing');
2425
ob_start();
25-
$result = $this->stack?->emit(
26+
$result = $this->stack->emit(
2627
$readHandle,
2728
new Response($writeHandle, StatusCode::OK)
2829
);
@@ -32,11 +33,11 @@ final class EmitterStackTest extends HackTest {
3233

3334
public function testShouldReturnMessageBody(): void {
3435
$sapiEmmiter = new SapiEmitter();
35-
$this->stack?->push($sapiEmmiter);
36+
$this->stack->push($sapiEmmiter);
3637
list($readHandle, $writeHandle) = IO\pipe_nd();
37-
$writeHandle->rawWriteBlocking('content');
38+
$writeHandle->write('content');
3839
ob_start();
39-
$_ = $this->stack?->emit(
40+
$_ = $this->stack->emit(
4041
$readHandle,
4142
new Response($writeHandle, StatusCode::OK)
4243
);
@@ -47,12 +48,12 @@ final class EmitterStackTest extends HackTest {
4748

4849
public function testEmitsResponseHeaders(): void {
4950
$sapiEmmiter = new OverrideSapiEmitter();
50-
$this->stack?->push($sapiEmmiter);
51+
$this->stack->push($sapiEmmiter);
5152
list($readHandle, $writeHandle) = IO\pipe_nd();
52-
$writeHandle->rawWriteBlocking('content');
53+
$writeHandle->write('content');
5354
$response = new TextResponse($writeHandle, StatusCode::OK);
5455
ob_start();
55-
$_ = $this->stack?->emit(
56+
$_ = $this->stack->emit(
5657
$readHandle,
5758
$response
5859
);
@@ -63,9 +64,11 @@ final class EmitterStackTest extends HackTest {
6364
expect($header)->toContainSubstring('Content-Type: text/plain');
6465
}
6566

66-
public function testMultipleSetCookieHeadersAreNotReplaced(): void {
67+
public async function testMultipleSetCookieHeadersAreNotReplaced(): Awaitable<void> {
6768
$sapiEmmiter = new OverrideSapiEmitter();
6869
list($readHandle, $writeHandle) = IO\pipe_nd();
70+
await $writeHandle->writeAsync('');
71+
await $writeHandle->closeAsync();
6972
$sapiEmmiter->emit($readHandle, (new Response($writeHandle))
7073
->withStatus(200)
7174
->withAddedHeader('Set-Cookie', vec['foo=bar', 'bar=baz']));
@@ -76,9 +79,11 @@ final class EmitterStackTest extends HackTest {
7679
]);
7780
}
7881

79-
public function testDoesNotLetResponseCodeBeOverriddenByHack(): void {
82+
public async function testDoesNotLetResponseCodeBeOverriddenByHack(): Awaitable<void> {
8083
$sapiEmmiter = new OverrideSapiEmitter();
8184
list($readHandle, $writeHandle) = IO\pipe_nd();
85+
await $writeHandle->writeAsync('');
86+
await $writeHandle->closeAsync();
8287
$response = (new Response($writeHandle))
8388
->withStatus(StatusCode::ACCEPTED)
8489
->withAddedHeader('Location', vec['http://api.my-service.com/12345678'])
@@ -97,13 +102,13 @@ final class EmitterStackTest extends HackTest {
97102

98103
public async function testShouldEmitOutput(): Awaitable<void> {
99104
$sapiEmmiter = new SapiEmitter();
100-
$this->stack?->push($sapiEmmiter);
101-
$this->stack?->push($sapiEmmiter);
105+
$this->stack->push($sapiEmmiter);
106+
$this->stack->push($sapiEmmiter);
102107
list($readHandle, $writeHandle) = IO\pipe_nd();
103108
await $writeHandle->writeAsync('content');
104109
await $writeHandle->closeAsync();
105110
ob_start();
106-
await $this->stack?->emitAsync(
111+
await $this->stack->emitAsync(
107112
$readHandle,
108113
new Response($writeHandle, StatusCode::OK)
109114
);

tests/MockRequestHandler.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class MockRequestHandler implements RequestHandlerInterface {
1313
IO\WriteHandle $handle,
1414
ServerRequestInterface $_request
1515
): ResponseInterface {
16-
$handle->rawWriteBlocking(json_encode(dict[]));
16+
$handle->write(json_encode(dict[]));
1717
return new Response($handle, StatusCode::OK);
1818
}
1919
}

0 commit comments

Comments
 (0)