Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -11,10 +11,11 @@
namespace Symfony\Component\HttpFoundation\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
class StreamedResponseTest extends \PHPUnit_Framework_TestCase
class StreamedResponseTest extends TestCase
{
public function testConstructor()
{
@@ -50,10 +51,12 @@ class StreamedResponseTest extends \PHPUnit_Framework_TestCase
public function testPrepareWithHeadRequest()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$response = new StreamedResponse(function () { echo 'foo'; }, 200, array('Content-Length' => '123'));
$request = Request::create('/', 'HEAD');
$response->prepare($request);
$this->assertSame('123', $response->headers->get('Content-Length'));
}
public function testPrepareWithCacheHeaders()
@@ -109,4 +112,33 @@ class StreamedResponseTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response);
$this->assertEquals(204, $response->getStatusCode());
}
public function testReturnThis()
{
$response = new StreamedResponse(function () {});
$this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendContent());
$this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendContent());
$response = new StreamedResponse(function () {});
$this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendHeaders());
$this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendHeaders());
}
public function testSetNotModified()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$modified = $response->setNotModified();
$this->assertObjectHasAttribute('headers', $modified);
$this->assertObjectHasAttribute('content', $modified);
$this->assertObjectHasAttribute('version', $modified);
$this->assertObjectHasAttribute('statusCode', $modified);
$this->assertObjectHasAttribute('statusText', $modified);
$this->assertObjectHasAttribute('charset', $modified);
$this->assertEquals(304, $modified->getStatusCode());
ob_start();
$modified->sendContent();
$string = ob_get_clean();
$this->assertEmpty($string);
}
}