From 79e74fbdfae62bc2594b1687e4cac61c37dd5334 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sat, 13 Apr 2024 19:37:00 +0200 Subject: [PATCH] Fix code style --- test/ResourceOutputStreamTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/ResourceOutputStreamTest.php b/test/ResourceOutputStreamTest.php index 5374c40..3760661 100644 --- a/test/ResourceOutputStreamTest.php +++ b/test/ResourceOutputStreamTest.php @@ -6,7 +6,6 @@ use Amp\ByteStream\StreamException; use Amp\PHPUnit\AsyncTestCase; use function Amp\delay; -use const PHP_OS; class ResourceOutputStreamTest extends AsyncTestCase { @@ -36,7 +35,7 @@ public function testNotWritable(): void public function testBrokenPipe(): ?\Generator { if (($sockets = @\stream_socket_pair( - \stripos(PHP_OS, "win") === 0 ? STREAM_PF_INET : STREAM_PF_UNIX, + \stripos(\PHP_OS, "win") === 0 ? STREAM_PF_INET : STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP )) === false) { @@ -49,12 +48,12 @@ public function testBrokenPipe(): ?\Generator \fclose($b); $this->expectException(StreamException::class); - $this->expectExceptionMessage(/* S|s */ "end of 6 bytes failed with errno=" . (\stripos(PHP_OS, "win") === 0 ? "10053" : "32 Broken pipe")); + $this->expectExceptionMessage(/* S|s */ "end of 6 bytes failed with errno=" . (\stripos(\PHP_OS, "win") === 0 ? "10053" : "32 Broken pipe")); yield $stream->write("foobar"); // The first write still succeeds somehow on Windows... - if (\stripos(PHP_OS, "win") === 0) { + if (\stripos(\PHP_OS, "win") === 0) { yield $stream->write("foobar"); } } @@ -71,7 +70,7 @@ public function testClosedRemoteSocket(): ?\Generator \fclose($b); $this->expectException(StreamException::class); - $this->expectExceptionMessage(/* S|s */ "end of 6 bytes failed with errno=" . (\stripos(PHP_OS, "win") === 0 ? "10053" : "32 Broken pipe")); + $this->expectExceptionMessage(/* S|s */ "end of 6 bytes failed with errno=" . (\stripos(\PHP_OS, "win") === 0 ? "10053" : "32 Broken pipe")); yield $stream->write("foobar"); // There's some delay until a write fails on macOS (and possibly other OSes)