Update composer dependencies

This commit is contained in:
Chris
2019-06-11 12:29:32 +01:00
parent 7d6df3843b
commit 1f608b1c21
1835 changed files with 74500 additions and 27482 deletions

View File

@@ -24,13 +24,13 @@ class JsonResponseTest extends TestCase
public function testConstructorWithArrayCreatesJsonArray()
{
$response = new JsonResponse(array(0, 1, 2, 3));
$response = new JsonResponse([0, 1, 2, 3]);
$this->assertSame('[0,1,2,3]', $response->getContent());
}
public function testConstructorWithAssocArrayCreatesJsonObject()
{
$response = new JsonResponse(array('foo' => 'bar'));
$response = new JsonResponse(['foo' => 'bar']);
$this->assertSame('{"foo":"bar"}', $response->getContent());
}
@@ -43,7 +43,8 @@ class JsonResponseTest extends TestCase
$this->assertSame('0', $response->getContent());
$response = new JsonResponse(0.1);
$this->assertSame('0.1', $response->getContent());
$this->assertEquals('0.1', $response->getContent());
$this->assertInternalType('string', $response->getContent());
$response = new JsonResponse(true);
$this->assertSame('true', $response->getContent());
@@ -51,7 +52,7 @@ class JsonResponseTest extends TestCase
public function testConstructorWithCustomStatus()
{
$response = new JsonResponse(array(), 202);
$response = new JsonResponse([], 202);
$this->assertSame(202, $response->getStatusCode());
}
@@ -63,35 +64,35 @@ class JsonResponseTest extends TestCase
public function testConstructorWithCustomHeaders()
{
$response = new JsonResponse(array(), 200, array('ETag' => 'foo'));
$response = new JsonResponse([], 200, ['ETag' => 'foo']);
$this->assertSame('application/json', $response->headers->get('Content-Type'));
$this->assertSame('foo', $response->headers->get('ETag'));
}
public function testConstructorWithCustomContentType()
{
$headers = array('Content-Type' => 'application/vnd.acme.blog-v1+json');
$headers = ['Content-Type' => 'application/vnd.acme.blog-v1+json'];
$response = new JsonResponse(array(), 200, $headers);
$response = new JsonResponse([], 200, $headers);
$this->assertSame('application/vnd.acme.blog-v1+json', $response->headers->get('Content-Type'));
}
public function testSetJson()
{
$response = new JsonResponse('1', 200, array(), true);
$response = new JsonResponse('1', 200, [], true);
$this->assertEquals('1', $response->getContent());
$response = new JsonResponse('[1]', 200, array(), true);
$response = new JsonResponse('[1]', 200, [], true);
$this->assertEquals('[1]', $response->getContent());
$response = new JsonResponse(null, 200, array());
$response = new JsonResponse(null, 200, []);
$response->setJson('true');
$this->assertEquals('true', $response->getContent());
}
public function testCreate()
{
$response = JsonResponse::create(array('foo' => 'bar'), 204);
$response = JsonResponse::create(['foo' => 'bar'], 204);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertEquals('{"foo":"bar"}', $response->getContent());
@@ -107,14 +108,14 @@ class JsonResponseTest extends TestCase
public function testStaticCreateJsonArray()
{
$response = JsonResponse::create(array(0, 1, 2, 3));
$response = JsonResponse::create([0, 1, 2, 3]);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertSame('[0,1,2,3]', $response->getContent());
}
public function testStaticCreateJsonObject()
{
$response = JsonResponse::create(array('foo' => 'bar'));
$response = JsonResponse::create(['foo' => 'bar']);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertSame('{"foo":"bar"}', $response->getContent());
}
@@ -131,7 +132,8 @@ class JsonResponseTest extends TestCase
$response = JsonResponse::create(0.1);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertSame('0.1', $response->getContent());
$this->assertEquals('0.1', $response->getContent());
$this->assertInternalType('string', $response->getContent());
$response = JsonResponse::create(true);
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
@@ -140,7 +142,7 @@ class JsonResponseTest extends TestCase
public function testStaticCreateWithCustomStatus()
{
$response = JsonResponse::create(array(), 202);
$response = JsonResponse::create([], 202);
$this->assertSame(202, $response->getStatusCode());
}
@@ -152,22 +154,22 @@ class JsonResponseTest extends TestCase
public function testStaticCreateWithCustomHeaders()
{
$response = JsonResponse::create(array(), 200, array('ETag' => 'foo'));
$response = JsonResponse::create([], 200, ['ETag' => 'foo']);
$this->assertSame('application/json', $response->headers->get('Content-Type'));
$this->assertSame('foo', $response->headers->get('ETag'));
}
public function testStaticCreateWithCustomContentType()
{
$headers = array('Content-Type' => 'application/vnd.acme.blog-v1+json');
$headers = ['Content-Type' => 'application/vnd.acme.blog-v1+json'];
$response = JsonResponse::create(array(), 200, $headers);
$response = JsonResponse::create([], 200, $headers);
$this->assertSame('application/vnd.acme.blog-v1+json', $response->headers->get('Content-Type'));
}
public function testSetCallback()
{
$response = JsonResponse::create(array('foo' => 'bar'))->setCallback('callback');
$response = JsonResponse::create(['foo' => 'bar'])->setCallback('callback');
$this->assertEquals('/**/callback({"foo":"bar"});', $response->getContent());
$this->assertEquals('text/javascript', $response->headers->get('Content-Type'));
@@ -190,7 +192,7 @@ class JsonResponseTest extends TestCase
public function testSetEncodingOptions()
{
$response = new JsonResponse();
$response->setData(array(array(1, 2, 3)));
$response->setData([[1, 2, 3]]);
$this->assertEquals('[[1,2,3]]', $response->getContent());
@@ -239,7 +241,7 @@ class JsonResponseTest extends TestCase
public function testSetComplexCallback()
{
$response = JsonResponse::create(array('foo' => 'bar'));
$response = JsonResponse::create(['foo' => 'bar']);
$response->setCallback('ಠ_ಠ["foo"].bar[0]');
$this->assertEquals('/**/ಠ_ಠ["foo"].bar[0]({"foo":"bar"});', $response->getContent());