aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Http/ResponseTest.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 09:30:18 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 16:34:56 +0100
commitb80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch)
treeec20e0ffa2f86b9b54939a83a785407319f94559 /tests/lib/AppFramework/Http/ResponseTest.php
parent62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff)
downloadnextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz
nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/AppFramework/Http/ResponseTest.php')
-rw-r--r--tests/lib/AppFramework/Http/ResponseTest.php62
1 files changed, 31 insertions, 31 deletions
diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php
index 3d76d24496d..86a909b7688 100644
--- a/tests/lib/AppFramework/Http/ResponseTest.php
+++ b/tests/lib/AppFramework/Http/ResponseTest.php
@@ -49,11 +49,11 @@ class ResponseTest extends \Test\TestCase {
public function testSetHeaders() {
- $expected = array(
+ $expected = [
'Last-Modified' => 1,
'ETag' => 3,
'Something-Else' => 'hi'
- );
+ ];
$this->childResponse->setHeaders($expected);
$headers = $this->childResponse->getHeaders();
@@ -105,31 +105,31 @@ class ResponseTest extends \Test\TestCase {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo', new \DateTime('1970-01-01'));
- $expectedResponse = array(
- 'foo' => array(
+ $expectedResponse = [
+ 'foo' => [
'value' => 'bar',
'expireDate' => null,
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'foo',
'expireDate' => new \DateTime('1970-01-01')
- )
- );
+ ]
+ ];
$this->assertEquals($expectedResponse, $this->childResponse->getCookies());
}
function testSetCookies() {
- $expected = array(
- 'foo' => array(
+ $expected = [
+ 'foo' => [
'value' => 'bar',
'expireDate' => null,
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'foo',
'expireDate' => new \DateTime('1970-01-01')
- )
- );
+ ]
+ ];
$this->childResponse->setCookies($expected);
$cookies = $this->childResponse->getCookies();
@@ -141,12 +141,12 @@ class ResponseTest extends \Test\TestCase {
function testInvalidateCookie() {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->invalidateCookie('foo');
- $expected = array(
- 'foo' => array(
+ $expected = [
+ 'foo' => [
'value' => 'expired',
'expireDate' => new \DateTime('1971-01-01')
- )
- );
+ ]
+ ];
$cookies = $this->childResponse->getCookies();
@@ -157,30 +157,30 @@ class ResponseTest extends \Test\TestCase {
function testInvalidateCookies() {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo');
- $expected = array(
- 'foo' => array(
+ $expected = [
+ 'foo' => [
'value' => 'bar',
'expireDate' => null
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'foo',
'expireDate' => null
- )
- );
+ ]
+ ];
$cookies = $this->childResponse->getCookies();
$this->assertEquals($expected, $cookies);
- $this->childResponse->invalidateCookies(array('foo', 'bar'));
- $expected = array(
- 'foo' => array(
+ $this->childResponse->invalidateCookies(['foo', 'bar']);
+ $expected = [
+ 'foo' => [
'value' => 'expired',
'expireDate' => new \DateTime('1971-01-01')
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'expired',
'expireDate' => new \DateTime('1971-01-01')
- )
- );
+ ]
+ ];
$cookies = $this->childResponse->getCookies();
$this->assertEquals($expected, $cookies);