Skip to content

Commit 4a4f7eb

Browse files
committed
fixed tests
1 parent 19a2d63 commit 4a4f7eb

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

.hhconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ disable_lval_as_an_expression = true
1212
new_inference_lambda = true
1313
error_php_lambdas = true
1414
allowed_decl_fixme_codes=2053,4045,4047
15-
allowed_fixme_codes_strict=2011,2049,2050,2053,2083,3004,3084,4027,4045,4047,4104,4106,4108,4110,4119,4128,4135,4188,4223,4240,4248,4323,4200
15+
allowed_fixme_codes_strict=2011,2049,2050,2053,2083,3004,3084,4027,4045,4047,4104,4106,4107,4108,4110,4119,4128,4135,4188,4223,4240,4248,4323,4200

tests/EmitterStackTest.hack

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class EmitterStackTest extends HackTest {
2020
public function testShouldEmitTrue(): void {
2121
$sapiEmmiter = new SapiEmitter();
2222
$this->stack->push($sapiEmmiter);
23-
list($readHandle, $writeHandle) = IO\pipe_nd();
23+
list($readHandle, $writeHandle) = IO\pipe();
2424
$writeHandle->write('testing');
2525
ob_start();
2626
$result = $this->stack->emit(
@@ -34,7 +34,7 @@ final class EmitterStackTest extends HackTest {
3434
public function testShouldReturnMessageBody(): void {
3535
$sapiEmmiter = new SapiEmitter();
3636
$this->stack->push($sapiEmmiter);
37-
list($readHandle, $writeHandle) = IO\pipe_nd();
37+
list($readHandle, $writeHandle) = IO\pipe();
3838
$writeHandle->write('content');
3939
ob_start();
4040
$_ = $this->stack->emit(
@@ -49,7 +49,7 @@ final class EmitterStackTest extends HackTest {
4949
public function testEmitsResponseHeaders(): void {
5050
$sapiEmmiter = new OverrideSapiEmitter();
5151
$this->stack->push($sapiEmmiter);
52-
list($readHandle, $writeHandle) = IO\pipe_nd();
52+
list($readHandle, $writeHandle) = IO\pipe();
5353
$writeHandle->write('content');
5454
$response = new TextResponse($writeHandle, StatusCode::OK);
5555
ob_start();
@@ -66,9 +66,9 @@ final class EmitterStackTest extends HackTest {
6666

6767
public async function testMultipleSetCookieHeadersAreNotReplaced(): Awaitable<void> {
6868
$sapiEmmiter = new OverrideSapiEmitter();
69-
list($readHandle, $writeHandle) = IO\pipe_nd();
69+
list($readHandle, $writeHandle) = IO\pipe();
7070
await $writeHandle->writeAsync('');
71-
await $writeHandle->closeAsync();
71+
$writeHandle->close();
7272
$sapiEmmiter->emit($readHandle, (new Response($writeHandle))
7373
->withStatus(200)
7474
->withAddedHeader('Set-Cookie', vec['foo=bar', 'bar=baz']));
@@ -81,9 +81,9 @@ final class EmitterStackTest extends HackTest {
8181

8282
public async function testDoesNotLetResponseCodeBeOverriddenByHack(): Awaitable<void> {
8383
$sapiEmmiter = new OverrideSapiEmitter();
84-
list($readHandle, $writeHandle) = IO\pipe_nd();
84+
list($readHandle, $writeHandle) = IO\pipe();
8585
await $writeHandle->writeAsync('');
86-
await $writeHandle->closeAsync();
86+
$writeHandle->close();
8787
$response = (new Response($writeHandle))
8888
->withStatus(StatusCode::ACCEPTED)
8989
->withAddedHeader('Location', vec['http://api.my-service.com/12345678'])
@@ -104,9 +104,9 @@ final class EmitterStackTest extends HackTest {
104104
$sapiEmmiter = new SapiEmitter();
105105
$this->stack->push($sapiEmmiter);
106106
$this->stack->push($sapiEmmiter);
107-
list($readHandle, $writeHandle) = IO\pipe_nd();
107+
list($readHandle, $writeHandle) = IO\pipe();
108108
await $writeHandle->writeAsync('content');
109-
await $writeHandle->closeAsync();
109+
$writeHandle->close();
110110
ob_start();
111111
await $this->stack->emitAsync(
112112
$readHandle,

tests/MockAsyncRequestHandler.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class MockAsyncRequestHandler implements AsyncRequestHandlerInterface {
1414
ServerRequestInterface $_request
1515
): Awaitable<ResponseInterface> {
1616
if($handle is IO\CloseableHandle) {
17-
await $handle->closeAsync();
17+
$handle->close();
1818
}
1919
return new Response($handle, StatusCode::OK);
2020
}

tests/RequestHandleExecutorTest.hack

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class RequestHandleExecutorTest extends HackTest {
1313
public function testShouldReturnNullStackEmitter(): void {
1414
$stack = new EmitterStack();
1515
$stack->push(new OverrideSapiEmitter());
16-
list($readHandle, $writeHandle) = IO\pipe_nd();
16+
list($readHandle, $writeHandle) = IO\pipe();
1717
$executor = new RequestHandleExecutor(
1818
$readHandle,
1919
$writeHandle,
@@ -28,7 +28,7 @@ final class RequestHandleExecutorTest extends HackTest {
2828
}
2929

3030
public function testShouldReturnNullSapiEmitter(): void {
31-
list($readHandle, $writeHandle) = IO\pipe_nd();
31+
list($readHandle, $writeHandle) = IO\pipe();
3232
$executor = new RequestHandleExecutor(
3333
$readHandle,
3434
$writeHandle,

tests/SapiEmitterTest.hack

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ final class SapiEmitterTest extends HackTest {
1111

1212
public async function testShouldAsync(): Awaitable<void> {
1313
$sapi = new SapiEmitter();
14-
list($readHandle, $writeHandle) = IO\pipe_nd();
14+
list($readHandle, $writeHandle) = IO\pipe();
1515
await $writeHandle->writeAsync('async content');
16-
await $writeHandle->closeAsync();
16+
$writeHandle->close();
1717
ob_start();
1818
await $sapi->emitAsync($readHandle, new Response($writeHandle, StatusCode::OK));
1919
$out = ob_get_contents();

0 commit comments

Comments
 (0)