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.144.132.48
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
react /
http-client /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
CallableStub.php
108
B
-rw-r--r--
2018-04-10 09:00
DecodeChunkedStreamTest.php
7.87
KB
-rw-r--r--
2018-04-10 09:00
FunctionalIntegrationTest.php
5.31
KB
-rw-r--r--
2018-04-10 09:00
RequestDataTest.php
4.51
KB
-rw-r--r--
2018-04-10 09:00
RequestTest.php
22.34
KB
-rw-r--r--
2018-04-10 09:00
ResponseTest.php
4.09
KB
-rw-r--r--
2018-04-10 09:00
TestCase.php
1.17
KB
-rw-r--r--
2018-04-10 09:00
bootstrap.php
206
B
-rw-r--r--
2018-04-10 09:00
Save
Rename
<?php namespace React\Tests\HttpClient; use React\HttpClient\Response; use React\Stream\ThroughStream; class ResponseTest extends TestCase { private $stream; public function setUp() { $this->stream = $this->getMockBuilder('React\Stream\DuplexStreamInterface') ->getMock(); } /** @test */ public function responseShouldEmitEndEventOnEnd() { $this->stream ->expects($this->at(0)) ->method('on') ->with('data', $this->anything()); $this->stream ->expects($this->at(1)) ->method('on') ->with('error', $this->anything()); $this->stream ->expects($this->at(2)) ->method('on') ->with('end', $this->anything()); $this->stream ->expects($this->at(3)) ->method('on') ->with('close', $this->anything()); $response = new Response($this->stream, 'HTTP', '1.0', '200', 'OK', array('Content-Type' => 'text/plain')); $handler = $this->createCallableMock(); $handler->expects($this->once()) ->method('__invoke') ->with('some data'); $response->on('data', $handler); $handler = $this->createCallableMock(); $handler->expects($this->once()) ->method('__invoke'); $response->on('end', $handler); $handler = $this->createCallableMock(); $handler->expects($this->once()) ->method('__invoke'); $response->on('close', $handler); $this->stream ->expects($this->at(0)) ->method('close'); $response->handleData('some data'); $response->handleEnd(); $this->assertSame( array( 'Content-Type' => 'text/plain' ), $response->getHeaders() ); } /** @test */ public function closedResponseShouldNotBeResumedOrPaused() { $response = new Response($this->stream, 'http', '1.0', '200', 'ok', array('content-type' => 'text/plain')); $this->stream ->expects($this->never()) ->method('pause'); $this->stream ->expects($this->never()) ->method('resume'); $response->handleEnd(); $response->resume(); $response->pause(); $this->assertSame( array( 'content-type' => 'text/plain', ), $response->getHeaders() ); } /** @test */ public function chunkedEncodingResponse() { $stream = new ThroughStream(); $response = new Response( $stream, 'http', '1.0', '200', 'ok', array( 'content-type' => 'text/plain', 'transfer-encoding' => 'chunked', ) ); $buffer = ''; $response->on('data', function ($data) use (&$buffer) { $buffer.= $data; }); $this->assertSame('', $buffer); $stream->write("4; abc=def\r\n"); $this->assertSame('', $buffer); $stream->write("Wiki\r\n"); $this->assertSame('Wiki', $buffer); $this->assertSame( array( 'content-type' => 'text/plain', ), $response->getHeaders() ); } /** @test */ public function doubleChunkedEncodingResponseWillBePassedAsIs() { $stream = new ThroughStream(); $response = new Response( $stream, 'http', '1.0', '200', 'ok', array( 'content-type' => 'text/plain', 'transfer-encoding' => array( 'chunked', 'chunked' ) ) ); $this->assertSame( array( 'content-type' => 'text/plain', 'transfer-encoding' => array( 'chunked', 'chunked' ) ), $response->getHeaders() ); } }