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.135.201.190
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp-test /
vendor /
ringcentral /
psr7 /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
AppendStreamTest.php
5.7
KB
-rw-r--r--
2018-01-15 21:00
BufferStreamTest.php
1.9
KB
-rw-r--r--
2018-01-15 21:00
CachingStreamTest.php
5.54
KB
-rw-r--r--
2018-01-15 21:00
DroppingStreamTest.php
919
B
-rw-r--r--
2018-01-15 21:00
FnStreamTest.php
2.55
KB
-rw-r--r--
2018-01-15 21:00
FunctionsTest.php
20.76
KB
-rw-r--r--
2018-01-15 21:00
InflateStreamTest.php
446
B
-rw-r--r--
2018-01-15 21:00
LazyOpenStreamTest.php
1.8
KB
-rw-r--r--
2018-01-15 21:00
LimitStreamTest.php
4.87
KB
-rw-r--r--
2018-01-15 21:00
MultipartStreamTest.php
5.24
KB
-rw-r--r--
2018-01-15 21:00
NoSeekStreamTest.php
1.12
KB
-rw-r--r--
2018-01-15 21:00
PumpStreamTest.php
2.17
KB
-rw-r--r--
2018-01-15 21:00
RequestTest.php
4.71
KB
-rw-r--r--
2018-01-15 21:00
ResponseTest.php
4.73
KB
-rw-r--r--
2018-01-15 21:00
ServerRequestTest.php
2.55
KB
-rw-r--r--
2018-01-15 21:00
StreamDecoratorTraitTest.php
3.22
KB
-rw-r--r--
2018-01-15 21:00
StreamTest.php
5.03
KB
-rw-r--r--
2018-01-15 21:00
StreamWrapperTest.php
3.12
KB
-rw-r--r--
2018-01-15 21:00
UriTest.php
10.18
KB
-rw-r--r--
2018-01-15 21:00
bootstrap.php
197
B
-rw-r--r--
2018-01-15 21:00
Save
Rename
<?php namespace RingCentral\Tests\Psr7; use RingCentral\Psr7\AppendStream; use RingCentral\Psr7; class AppendStreamTest extends \PHPUnit_Framework_TestCase { /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Each stream must be readable */ public function testValidatesStreamsAreReadable() { $a = new AppendStream(); $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') ->setMethods(array('isReadable')) ->getMockForAbstractClass(); $s->expects($this->once()) ->method('isReadable') ->will($this->returnValue(false)); $a->addStream($s); } /** * @expectedException \RuntimeException * @expectedExceptionMessage The AppendStream can only seek with SEEK_SET */ public function testValidatesSeekType() { $a = new AppendStream(); $a->seek(100, SEEK_CUR); } /** * @expectedException \RuntimeException * @expectedExceptionMessage Unable to seek stream 0 of the AppendStream */ public function testTriesToRewindOnSeek() { $a = new AppendStream(); $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') ->setMethods(array('isReadable', 'rewind', 'isSeekable')) ->getMockForAbstractClass(); $s->expects($this->once()) ->method('isReadable') ->will($this->returnValue(true)); $s->expects($this->once()) ->method('isSeekable') ->will($this->returnValue(true)); $s->expects($this->once()) ->method('rewind') ->will($this->throwException(new \RuntimeException())); $a->addStream($s); $a->seek(10); } public function testSeeksToPositionByReading() { $a = new AppendStream(array( Psr7\stream_for('foo'), Psr7\stream_for('bar'), Psr7\stream_for('baz'), )); $a->seek(3); $this->assertEquals(3, $a->tell()); $this->assertEquals('bar', $a->read(3)); $a->seek(6); $this->assertEquals(6, $a->tell()); $this->assertEquals('baz', $a->read(3)); } public function testDetachesEachStream() { $s1 = Psr7\stream_for('foo'); $s2 = Psr7\stream_for('bar'); $a = new AppendStream(array($s1, $s2)); $this->assertSame('foobar', (string) $a); $a->detach(); $this->assertSame('', (string) $a); $this->assertSame(0, $a->getSize()); } public function testClosesEachStream() { $s1 = Psr7\stream_for('foo'); $a = new AppendStream(array($s1)); $a->close(); $this->assertSame('', (string) $a); } /** * @expectedExceptionMessage Cannot write to an AppendStream * @expectedException \RuntimeException */ public function testIsNotWritable() { $a = new AppendStream(array(Psr7\stream_for('foo'))); $this->assertFalse($a->isWritable()); $this->assertTrue($a->isSeekable()); $this->assertTrue($a->isReadable()); $a->write('foo'); } public function testDoesNotNeedStreams() { $a = new AppendStream(); $this->assertEquals('', (string) $a); } public function testCanReadFromMultipleStreams() { $a = new AppendStream(array( Psr7\stream_for('foo'), Psr7\stream_for('bar'), Psr7\stream_for('baz'), )); $this->assertFalse($a->eof()); $this->assertSame(0, $a->tell()); $this->assertEquals('foo', $a->read(3)); $this->assertEquals('bar', $a->read(3)); $this->assertEquals('baz', $a->read(3)); $this->assertSame('', $a->read(1)); $this->assertTrue($a->eof()); $this->assertSame(9, $a->tell()); $this->assertEquals('foobarbaz', (string) $a); } public function testCanDetermineSizeFromMultipleStreams() { $a = new AppendStream(array( Psr7\stream_for('foo'), Psr7\stream_for('bar') )); $this->assertEquals(6, $a->getSize()); $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') ->setMethods(array('isSeekable', 'isReadable')) ->getMockForAbstractClass(); $s->expects($this->once()) ->method('isSeekable') ->will($this->returnValue(null)); $s->expects($this->once()) ->method('isReadable') ->will($this->returnValue(true)); $a->addStream($s); $this->assertNull($a->getSize()); } public function testCatchesExceptionsWhenCastingToString() { $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') ->setMethods(array('isSeekable', 'read', 'isReadable', 'eof')) ->getMockForAbstractClass(); $s->expects($this->once()) ->method('isSeekable') ->will($this->returnValue(true)); $s->expects($this->once()) ->method('read') ->will($this->throwException(new \RuntimeException('foo'))); $s->expects($this->once()) ->method('isReadable') ->will($this->returnValue(true)); $s->expects($this->any()) ->method('eof') ->will($this->returnValue(false)); $a = new AppendStream(array($s)); $this->assertFalse($a->eof()); $this->assertSame('', (string) $a); } public function testCanDetach() { $s = new AppendStream(); $s->detach(); } public function testReturnsEmptyMetadata() { $s = new AppendStream(); $this->assertEquals(array(), $s->getMetadata()); $this->assertNull($s->getMetadata('foo')); } }