@@ -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_non_disposable ();
23+ list ($readHandle , $writeHandle ) = IO \pipe_nd ();
2424 ob_start ();
2525 $result = $this -> stack ?-> emit(
2626 $readHandle ,
@@ -33,10 +33,10 @@ final class EmitterStackTest extends HackTest {
3333 public function testShouldReturnMessageBody (): void {
3434 $sapiEmmiter = new SapiEmitter ();
3535 $this -> stack ?-> push($sapiEmmiter );
36- list ($readHandle , $writeHandle ) = IO \pipe_non_disposable ();
36+ list ($readHandle , $writeHandle ) = IO \pipe_nd ();
3737 $writeHandle -> rawWriteBlocking(' content' );
3838 ob_start ();
39- $result = $this -> stack ?-> emit(
39+ $_ = $this -> stack ?-> emit(
4040 $readHandle ,
4141 new Response ($writeHandle , StatusCode :: OK )
4242 );
@@ -48,24 +48,24 @@ final class EmitterStackTest extends HackTest {
4848 public function testEmitsResponseHeaders (): void {
4949 $sapiEmmiter = new OverrideSapiEmitter ();
5050 $this -> stack ?-> push($sapiEmmiter );
51- list ($readHandle , $writeHandle ) = IO \pipe_non_disposable ();
51+ list ($readHandle , $writeHandle ) = IO \pipe_nd ();
5252 $writeHandle -> rawWriteBlocking(' content' );
5353 $response = new TextResponse ($writeHandle , StatusCode :: OK );
5454 ob_start ();
55- $result = $this -> stack ?-> emit(
55+ $_ = $this -> stack ?-> emit(
5656 $readHandle ,
5757 $response
5858 );
5959 $out = ob_get_contents ();
6060 ob_end_clean ();
6161 expect ($out )-> toBeSame(' content' );
6262 list ($header , $_ , $_ ) = $sapiEmmiter -> getPutHeaders()[0 ];
63- expect ($header )-> toContain (' Content-Type: text/plain' );
63+ expect ($header )-> toContainSubstring (' Content-Type: text/plain' );
6464 }
6565
6666 public function testMultipleSetCookieHeadersAreNotReplaced (): void {
6767 $sapiEmmiter = new OverrideSapiEmitter ();
68- list ($readHandle , $writeHandle ) = IO \pipe_non_disposable ();
68+ list ($readHandle , $writeHandle ) = IO \pipe_nd ();
6969 $sapiEmmiter -> emit($readHandle , (new Response ($writeHandle ))
7070 -> withStatus(200 )
7171 -> withAddedHeader(' Set-Cookie' , vec [' foo=bar' , ' bar=baz' ]));
@@ -78,16 +78,12 @@ final class EmitterStackTest extends HackTest {
7878
7979 public function testDoesNotLetResponseCodeBeOverriddenByHack (): void {
8080 $sapiEmmiter = new OverrideSapiEmitter ();
81- list ($readHandle , $writeHandle ) = IO \pipe_non_disposable ();
81+ list ($readHandle , $writeHandle ) = IO \pipe_nd ();
8282 $response = (new Response ($writeHandle ))
8383 -> withStatus(StatusCode :: ACCEPTED )
8484 -> withAddedHeader(' Location' , vec [' http://api.my-service.com/12345678' ])
8585 -> withAddedHeader(' Content-Type' , vec [' text/plain' ]);
8686 $sapiEmmiter -> emit($readHandle , $response );
87- $expectedStack = vec [
88- tuple (' Location: http://api.my-service.com/12345678' , true , 202 ),
89- tuple (' Content-Type: text/plain' , true , 202 ),
90- ];
9187 expect ($sapiEmmiter -> getPutHeaders())
9288 -> toBeSame(vec [
9389 tuple (' Location: http://api.my-service.com/12345678' , true , 202 ),
@@ -103,7 +99,7 @@ final class EmitterStackTest extends HackTest {
10399 $sapiEmmiter = new SapiEmitter ();
104100 $this -> stack ?-> push($sapiEmmiter );
105101 $this -> stack ?-> push($sapiEmmiter );
106- list ($readHandle , $writeHandle ) = IO \pipe_non_disposable ();
102+ list ($readHandle , $writeHandle ) = IO \pipe_nd ();
107103 await $writeHandle -> writeAsync(' content' );
108104 await $writeHandle -> closeAsync();
109105 ob_start ();
0 commit comments