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; use RingCentral\Psr7\FnStream; use RingCentral\Psr7\Stream; use RingCentral\Psr7\LimitStream; use RingCentral\Psr7\NoSeekStream; /** * @covers RingCentral\Psr7\LimitStream */ class LimitStreamTest extends \PHPUnit_Framework_TestCase { /** @var LimitStream */ protected $body; /** @var Stream */ protected $decorated; public function setUp() { $this->decorated = Psr7\stream_for(fopen(__FILE__, 'r')); $this->body = new LimitStream($this->decorated, 10, 3); } public function testReturnsSubset() { $body = new LimitStream(Psr7\stream_for('foo'), -1, 1); $this->assertEquals('oo', (string) $body); $this->assertTrue($body->eof()); $body->seek(0); $this->assertFalse($body->eof()); $this->assertEquals('oo', $body->read(100)); $this->assertSame('', $body->read(1)); $this->assertTrue($body->eof()); } public function testReturnsSubsetWhenCastToString() { $body = Psr7\stream_for('foo_baz_bar'); $limited = new LimitStream($body, 3, 4); $this->assertEquals('baz', (string) $limited); } /** * @expectedException \RuntimeException * @expectedExceptionMessage Unable to seek to stream position 10 with whence 0 */ public function testEnsuresPositionCanBeekSeekedTo() { new LimitStream(Psr7\stream_for(''), 0, 10); } public function testReturnsSubsetOfEmptyBodyWhenCastToString() { $body = Psr7\stream_for('01234567891234'); $limited = new LimitStream($body, 0, 10); $this->assertEquals('', (string) $limited); } public function testReturnsSpecificSubsetOBodyWhenCastToString() { $body = Psr7\stream_for('0123456789abcdef'); $limited = new LimitStream($body, 3, 10); $this->assertEquals('abc', (string) $limited); } public function testSeeksWhenConstructed() { $this->assertEquals(0, $this->body->tell()); $this->assertEquals(3, $this->decorated->tell()); } public function testAllowsBoundedSeek() { $this->body->seek(100); $this->assertEquals(10, $this->body->tell()); $this->assertEquals(13, $this->decorated->tell()); $this->body->seek(0); $this->assertEquals(0, $this->body->tell()); $this->assertEquals(3, $this->decorated->tell()); try { $this->body->seek(-10); $this->fail(); } catch (\RuntimeException $e) {} $this->assertEquals(0, $this->body->tell()); $this->assertEquals(3, $this->decorated->tell()); $this->body->seek(5); $this->assertEquals(5, $this->body->tell()); $this->assertEquals(8, $this->decorated->tell()); // Fail try { $this->body->seek(1000, SEEK_END); $this->fail(); } catch (\RuntimeException $e) {} } public function testReadsOnlySubsetOfData() { $data = $this->body->read(100); $this->assertEquals(10, strlen($data)); $this->assertSame('', $this->body->read(1000)); $this->body->setOffset(10); $newData = $this->body->read(100); $this->assertEquals(10, strlen($newData)); $this->assertNotSame($data, $newData); } /** * @expectedException \RuntimeException * @expectedExceptionMessage Could not seek to stream offset 2 */ public function testThrowsWhenCurrentGreaterThanOffsetSeek() { $a = Psr7\stream_for('foo_bar'); $b = new NoSeekStream($a); $c = new LimitStream($b); $a->getContents(); $c->setOffset(2); } public function testCanGetContentsWithoutSeeking() { $a = Psr7\stream_for('foo_bar'); $b = new NoSeekStream($a); $c = new LimitStream($b); $this->assertEquals('foo_bar', $c->getContents()); } public function testClaimsConsumedWhenReadLimitIsReached() { $this->assertFalse($this->body->eof()); $this->body->read(1000); $this->assertTrue($this->body->eof()); } public function testContentLengthIsBounded() { $this->assertEquals(10, $this->body->getSize()); } public function testGetContentsIsBasedOnSubset() { $body = new LimitStream(Psr7\stream_for('foobazbar'), 3, 3); $this->assertEquals('baz', $body->getContents()); } public function testReturnsNullIfSizeCannotBeDetermined() { $a = new FnStream(array( 'getSize' => function () { return null; }, 'tell' => function () { return 0; }, )); $b = new LimitStream($a); $this->assertNull($b->getSize()); } public function testLengthLessOffsetWhenNoLimitSize() { $a = Psr7\stream_for('foo_bar'); $b = new LimitStream($a, -1, 4); $this->assertEquals(3, $b->getSize()); } }