OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
Xpress
/
vendor
/
guzzlehttp
/
psr7
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📄
AppendStreamTest.php
6.91 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
BufferStreamTest.php
1.98 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
CachingStreamTest.php
6.62 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
DroppingStreamTest.php
964 bytes
05/19/2025 10:07:16 AM
rw-r--r--
📄
FnStreamTest.php
3.75 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
HasToString.php
177 bytes
05/19/2025 10:07:16 AM
rw-r--r--
📄
HeaderTest.php
6.14 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
InflateStreamTest.php
3.06 KB
05/19/2025 10:07:16 AM
rw-r--r--
📁
Integration
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📄
LazyOpenStreamTest.php
1.88 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
LimitStreamTest.php
4.94 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
MessageTest.php
12.73 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
MimeTypeTest.php
617 bytes
05/19/2025 10:07:16 AM
rw-r--r--
📄
MultipartStreamTest.php
9.67 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
NoSeekStreamTest.php
1.05 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
PumpStreamTest.php
3.13 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
QueryTest.php
4.1 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ReadSeekOnlyStream.php
460 bytes
05/19/2025 10:07:16 AM
rw-r--r--
📄
RequestTest.php
10.78 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ResponseTest.php
13.89 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
ServerRequestTest.php
20.07 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
StreamDecoratorTraitTest.php
3.81 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
StreamTest.php
12.89 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
StreamWrapperTest.php
5.52 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
UploadedFileTest.php
6.63 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
UriComparatorTest.php
1.81 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
UriNormalizerTest.php
7.06 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
UriResolverTest.php
10.89 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
UriTest.php
27.18 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
UtilsTest.php
18.04 KB
05/19/2025 10:07:16 AM
rw-r--r--
Editing: StreamDecoratorTraitTest.php
Close
<?php declare(strict_types=1); namespace GuzzleHttp\Tests\Psr7; use GuzzleHttp\Psr7; use GuzzleHttp\Psr7\StreamDecoratorTrait; use PHPUnit\Framework\TestCase; use Psr\Http\Message\StreamInterface; class Str implements StreamInterface { use StreamDecoratorTrait; /** @var StreamInterface */ private $stream; } /** * @covers \GuzzleHttp\Psr7\StreamDecoratorTrait */ class StreamDecoratorTraitTest extends TestCase { /** @var StreamInterface */ private $a; /** @var StreamInterface */ private $b; /** @var resource */ private $c; protected function setUp(): void { $this->c = fopen('php://temp', 'r+'); fwrite($this->c, 'foo'); fseek($this->c, 0); $this->a = Psr7\Utils::streamFor($this->c); $this->b = new Str($this->a); } /** * @requires PHP < 7.4 */ public function testCatchesExceptionsWhenCastingToString(): void { $s = $this->createMock(Str::class); $s->expects(self::once()) ->method('read') ->willThrowException(new \RuntimeException('foo')); $msg = ''; set_error_handler(function (int $errNo, string $str) use (&$msg): void { $msg = $str; }); echo new Str($s); restore_error_handler(); self::assertStringContainsString('foo', $msg); } public function testToString(): void { self::assertSame('foo', (string) $this->b); } public function testHasSize(): void { self::assertSame(3, $this->b->getSize()); } public function testReads(): void { self::assertSame('foo', $this->b->read(10)); } public function testCheckMethods(): void { self::assertSame($this->a->isReadable(), $this->b->isReadable()); self::assertSame($this->a->isWritable(), $this->b->isWritable()); self::assertSame($this->a->isSeekable(), $this->b->isSeekable()); } public function testSeeksAndTells(): void { $this->b->seek(1); self::assertSame(1, $this->a->tell()); self::assertSame(1, $this->b->tell()); $this->b->seek(0); self::assertSame(0, $this->a->tell()); self::assertSame(0, $this->b->tell()); $this->b->seek(0, SEEK_END); self::assertSame(3, $this->a->tell()); self::assertSame(3, $this->b->tell()); } public function testGetsContents(): void { self::assertSame('foo', $this->b->getContents()); self::assertSame('', $this->b->getContents()); $this->b->seek(1); self::assertSame('oo', $this->b->getContents()); } public function testCloses(): void { $this->b->close(); self::assertFalse(is_resource($this->c)); } public function testDetaches(): void { $this->b->detach(); self::assertFalse($this->b->isReadable()); } public function testWrapsMetadata(): void { self::assertSame($this->b->getMetadata(), $this->a->getMetadata()); self::assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri')); } public function testWrapsWrites(): void { $this->b->seek(0, SEEK_END); $this->b->write('foo'); self::assertSame('foofoo', (string) $this->a); } public function testThrowsWithInvalidGetter(): void { $this->expectException(\UnexpectedValueException::class); $this->b->foo; } public function testThrowsWhenGetterNotImplemented(): void { $this->expectException(\BadMethodCallException::class); $s = new BadStream(); $s->stream; } } class BadStream { use StreamDecoratorTrait; public function __construct() { } }