aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Http/ResponseTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Http/ResponseTest.php')
-rw-r--r--tests/lib/AppFramework/Http/ResponseTest.php42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php
index d01d29e7071..28614b14b40 100644
--- a/tests/lib/AppFramework/Http/ResponseTest.php
+++ b/tests/lib/AppFramework/Http/ResponseTest.php
@@ -24,14 +24,14 @@ class ResponseTest extends \Test\TestCase {
}
- public function testAddHeader() {
+ public function testAddHeader(): void {
$this->childResponse->addHeader(' hello ', 'world');
$headers = $this->childResponse->getHeaders();
$this->assertEquals('world', $headers['hello']);
}
- public function testSetHeaders() {
+ public function testSetHeaders(): void {
$expected = [
'Last-Modified' => 1,
'ETag' => 3,
@@ -50,7 +50,7 @@ class ResponseTest extends \Test\TestCase {
$this->assertEquals($expected, $headers);
}
- public function testOverwriteCsp() {
+ public function testOverwriteCsp(): void {
$expected = [
'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' 'unsafe-inline';style-src 'self' 'unsafe-inline';img-src 'self';font-src 'self' data:;connect-src 'self';media-src 'self'",
];
@@ -62,31 +62,31 @@ class ResponseTest extends \Test\TestCase {
$this->assertEquals(array_merge($expected, $headers), $headers);
}
- public function testGetCsp() {
+ public function testGetCsp(): void {
$policy = new Http\ContentSecurityPolicy();
$this->childResponse->setContentSecurityPolicy($policy);
$this->assertEquals($policy, $this->childResponse->getContentSecurityPolicy());
}
- public function testGetCspEmpty() {
+ public function testGetCspEmpty(): void {
$this->assertEquals(new Http\EmptyContentSecurityPolicy(), $this->childResponse->getContentSecurityPolicy());
}
- public function testAddHeaderValueNullDeletesIt() {
+ public function testAddHeaderValueNullDeletesIt(): void {
$this->childResponse->addHeader('hello', 'world');
$this->childResponse->addHeader('hello', null);
$this->assertEquals(5, count($this->childResponse->getHeaders()));
}
- public function testCacheHeadersAreDisabledByDefault() {
+ public function testCacheHeadersAreDisabledByDefault(): void {
$headers = $this->childResponse->getHeaders();
$this->assertEquals('no-cache, no-store, must-revalidate', $headers['Cache-Control']);
}
- public function testAddCookie() {
+ public function testAddCookie(): void {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo', new \DateTime('1970-01-01'));
@@ -106,7 +106,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testSetCookies() {
+ public function testSetCookies(): void {
$expected = [
'foo' => [
'value' => 'bar',
@@ -125,7 +125,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testInvalidateCookie() {
+ public function testInvalidateCookie(): void {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->invalidateCookie('foo');
$expected = [
@@ -142,7 +142,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testInvalidateCookies() {
+ public function testInvalidateCookies(): void {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo');
$expected = [
@@ -179,12 +179,12 @@ class ResponseTest extends \Test\TestCase {
}
- public function testRenderReturnNullByDefault() {
+ public function testRenderReturnNullByDefault(): void {
$this->assertEquals(null, $this->childResponse->render());
}
- public function testGetStatus() {
+ public function testGetStatus(): void {
$default = $this->childResponse->getStatus();
$this->childResponse->setStatus(Http::STATUS_NOT_FOUND);
@@ -194,13 +194,13 @@ class ResponseTest extends \Test\TestCase {
}
- public function testGetEtag() {
+ public function testGetEtag(): void {
$this->childResponse->setEtag('hi');
$this->assertSame('hi', $this->childResponse->getEtag());
}
- public function testGetLastModified() {
+ public function testGetLastModified(): void {
$lastModified = new \DateTime('now', new \DateTimeZone('GMT'));
$lastModified->setTimestamp(1);
$this->childResponse->setLastModified($lastModified);
@@ -209,7 +209,7 @@ class ResponseTest extends \Test\TestCase {
- public function testCacheSecondsZero() {
+ public function testCacheSecondsZero(): void {
$this->childResponse->cacheFor(0);
$headers = $this->childResponse->getHeaders();
@@ -218,7 +218,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testCacheSeconds() {
+ public function testCacheSeconds(): void {
$time = $this->createMock(ITimeFactory::class);
$time->method('getTime')
->willReturn(1234567);
@@ -234,7 +234,7 @@ class ResponseTest extends \Test\TestCase {
- public function testEtagLastModifiedHeaders() {
+ public function testEtagLastModifiedHeaders(): void {
$lastModified = new \DateTime('now', new \DateTimeZone('GMT'));
$lastModified->setTimestamp(1);
$this->childResponse->setLastModified($lastModified);
@@ -242,7 +242,7 @@ class ResponseTest extends \Test\TestCase {
$this->assertEquals('Thu, 01 Jan 1970 00:00:01 +0000', $headers['Last-Modified']);
}
- public function testChainability() {
+ public function testChainability(): void {
$lastModified = new \DateTime('now', new \DateTimeZone('GMT'));
$lastModified->setTimestamp(1);
@@ -262,13 +262,13 @@ class ResponseTest extends \Test\TestCase {
$headers['Cache-Control']);
}
- public function testThrottle() {
+ public function testThrottle(): void {
$this->assertFalse($this->childResponse->isThrottled());
$this->childResponse->throttle();
$this->assertTrue($this->childResponse->isThrottled());
}
- public function testGetThrottleMetadata() {
+ public function testGetThrottleMetadata(): void {
$this->childResponse->throttle(['foo' => 'bar']);
$this->assertSame(['foo' => 'bar'], $this->childResponse->getThrottleMetadata());
}