diff options
author | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
commit | 8bec661288b276c98bdb0e773e5f4d5275dc4c87 (patch) | |
tree | 8617ebe581c62fc46a7881aa61801ebce9d3c603 /vendor/aws/aws-crt-php/tests/StreamTest.php | |
parent | 540438c2eb5452bacad30c247906bfa287f2da1d (diff) |
Diffstat (limited to 'vendor/aws/aws-crt-php/tests/StreamTest.php')
-rw-r--r-- | vendor/aws/aws-crt-php/tests/StreamTest.php | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/vendor/aws/aws-crt-php/tests/StreamTest.php b/vendor/aws/aws-crt-php/tests/StreamTest.php deleted file mode 100644 index f8a116a..0000000 --- a/vendor/aws/aws-crt-php/tests/StreamTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ -use AWS\CRT\IO\InputStream as InputStream; - -require_once('common.inc'); - -final class InputStreamTest extends CrtTestCase { - - const MEM_STREAM_CONTENTS = "THIS IS A TEST"; - - private function getMemoryStream() { - $stream = fopen("php://memory", 'r+'); - fputs($stream, self::MEM_STREAM_CONTENTS); - rewind($stream); - return $stream; - } - - public function testMemoryStream() { - $mem_stream = $this->getMemoryStream(); - $stream = new InputStream($mem_stream); - $this->assertNotNull($stream, "Failed to create InputStream from PHP memory stream"); - $this->assertEquals(strlen(self::MEM_STREAM_CONTENTS), $stream->length(), "Stream length doesn't match source buffer"); - $this->assertEquals(self::MEM_STREAM_CONTENTS, $stream->read(), "Stream doesn't match source buffer"); - $this->assertTrue($stream->eof(), "Stream is not EOF after reading"); - $this->assertEquals(0, $stream->seek(0, InputStream::SEEK_BEGIN), "Unable to rewind stream"); - $this->assertFalse($stream->eof(), "Stream is EOF after rewinding"); - $this->assertEquals(0, $stream->seek(0, InputStream::SEEK_END), "Unable to seek to end of stream"); - $this->assertTrue($stream->eof(), "Stream is not EOF after seeking to end"); - $stream = null; - } -} |