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.140.254.100
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; use RingCentral\Psr7; use RingCentral\Psr7\MultipartStream; class MultipartStreamTest extends \PHPUnit_Framework_TestCase { public function testCreatesDefaultBoundary() { $b = new MultipartStream(); $this->assertNotEmpty($b->getBoundary()); } public function testCanProvideBoundary() { $b = new MultipartStream(array(), 'foo'); $this->assertEquals('foo', $b->getBoundary()); } public function testIsNotWritable() { $b = new MultipartStream(); $this->assertFalse($b->isWritable()); } public function testCanCreateEmptyStream() { $b = new MultipartStream(); $boundary = $b->getBoundary(); $this->assertSame("--{$boundary}--\r\n", $b->getContents()); $this->assertSame(strlen($boundary) + 6, $b->getSize()); } /** * @expectedException \InvalidArgumentException */ public function testValidatesFilesArrayElement() { new MultipartStream(array(array('foo' => 'bar'))); } /** * @expectedException \InvalidArgumentException */ public function testEnsuresFileHasName() { new MultipartStream(array(array('contents' => 'bar'))); } public function testSerializesFields() { $b = new MultipartStream(array( array( 'name' => 'foo', 'contents' => 'bar' ), array( 'name' => 'baz', 'contents' => 'bam' ) ), 'boundary'); $this->assertEquals( "--boundary\r\nContent-Disposition: form-data; name=\"foo\"\r\nContent-Length: 3\r\n\r\n" . "bar\r\n--boundary\r\nContent-Disposition: form-data; name=\"baz\"\r\nContent-Length: 3" . "\r\n\r\nbam\r\n--boundary--\r\n", (string) $b); } public function testSerializesFiles() { $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), array( 'getMetadata' => function () { return '/foo/bar.txt'; } )); $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), array( 'getMetadata' => function () { return '/foo/baz.jpg'; } )); $f3 = Psr7\FnStream::decorate(Psr7\stream_for('bar'), array( 'getMetadata' => function () { return '/foo/bar.gif'; } )); $b = new MultipartStream(array( array( 'name' => 'foo', 'contents' => $f1 ), array( 'name' => 'qux', 'contents' => $f2 ), array( 'name' => 'qux', 'contents' => $f3 ), ), 'boundary'); $expected = <<<EOT --boundary Content-Disposition: form-data; name="foo"; filename="bar.txt" Content-Length: 3 Content-Type: text/plain foo --boundary Content-Disposition: form-data; name="qux"; filename="baz.jpg" Content-Length: 3 Content-Type: image/jpeg baz --boundary Content-Disposition: form-data; name="qux"; filename="bar.gif" Content-Length: 3 Content-Type: image/gif bar --boundary-- EOT; $this->assertEquals($expected, str_replace("\r", '', $b)); } public function testSerializesFilesWithCustomHeaders() { $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), array( 'getMetadata' => function () { return '/foo/bar.txt'; } )); $b = new MultipartStream(array( array( 'name' => 'foo', 'contents' => $f1, 'headers' => array( 'x-foo' => 'bar', 'content-disposition' => 'custom' ) ) ), 'boundary'); $expected = <<<EOT --boundary x-foo: bar content-disposition: custom Content-Length: 3 Content-Type: text/plain foo --boundary-- EOT; $this->assertEquals($expected, str_replace("\r", '', $b)); } public function testSerializesFilesWithCustomHeadersAndMultipleValues() { $f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), array( 'getMetadata' => function () { return '/foo/bar.txt'; } )); $f2 = Psr7\FnStream::decorate(Psr7\stream_for('baz'), array( 'getMetadata' => function () { return '/foo/baz.jpg'; } )); $b = new MultipartStream(array( array( 'name' => 'foo', 'contents' => $f1, 'headers' => array( 'x-foo' => 'bar', 'content-disposition' => 'custom' ) ), array( 'name' => 'foo', 'contents' => $f2, 'headers' => array('cOntenT-Type' => 'custom'), ) ), 'boundary'); $expected = <<<EOT --boundary x-foo: bar content-disposition: custom Content-Length: 3 Content-Type: text/plain foo --boundary cOntenT-Type: custom Content-Disposition: form-data; name="foo"; filename="baz.jpg" Content-Length: 3 baz --boundary-- EOT; $this->assertEquals($expected, str_replace("\r", '', $b)); } }