summaryrefslogtreecommitdiff
path: root/tests/app/Http/RequestHandlers
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2022-04-05 16:01:59 +0100
committerGreg Roach <greg@subaqua.co.uk>2022-04-05 16:01:59 +0100
commit6172e7f6cb6d9b42e9feef9b728f7561b0d70dc9 (patch)
tree931a4a533937480e53e0198679e362c845bf65c3 /tests/app/Http/RequestHandlers
parent6c21f8bee87860f3207f654266c478a05acfbcba (diff)
downloadwebtrees-6172e7f6cb6d9b42e9feef9b728f7561b0d70dc9.tar.gz
webtrees-6172e7f6cb6d9b42e9feef9b728f7561b0d70dc9.tar.bz2
webtrees-6172e7f6cb6d9b42e9feef9b728f7561b0d70dc9.zip
Upper/lower case mismatch causes wrong content-type header for CSV download
Diffstat (limited to 'tests/app/Http/RequestHandlers')
-rw-r--r--tests/app/Http/RequestHandlers/MapDataExportCSVTest.php2
-rw-r--r--tests/app/Http/RequestHandlers/MapDataExportGeoJsonTest.php2
-rw-r--r--tests/app/Http/RequestHandlers/MapDataImportPageTest.php2
-rw-r--r--tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php8
4 files changed, 8 insertions, 6 deletions
diff --git a/tests/app/Http/RequestHandlers/MapDataExportCSVTest.php b/tests/app/Http/RequestHandlers/MapDataExportCSVTest.php
index 232afb7445..24b1e52968 100644
--- a/tests/app/Http/RequestHandlers/MapDataExportCSVTest.php
+++ b/tests/app/Http/RequestHandlers/MapDataExportCSVTest.php
@@ -43,6 +43,6 @@ class MapDataExportCSVTest extends TestCase
$response = $handler->handle($request);
self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
- self::assertSame($response->getHeaderLine('Content-Type'), 'text/csv; charset=UTF-8');
+ self::assertSame($response->getHeaderLine('content-type'), 'text/csv; charset=UTF-8');
}
}
diff --git a/tests/app/Http/RequestHandlers/MapDataExportGeoJsonTest.php b/tests/app/Http/RequestHandlers/MapDataExportGeoJsonTest.php
index 7d501ac2c3..157e0e9f03 100644
--- a/tests/app/Http/RequestHandlers/MapDataExportGeoJsonTest.php
+++ b/tests/app/Http/RequestHandlers/MapDataExportGeoJsonTest.php
@@ -43,6 +43,6 @@ class MapDataExportGeoJsonTest extends TestCase
$response = $handler->handle($request);
self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
- self::assertSame($response->getHeaderLine('Content-Type'), 'application/vnd.geo+json');
+ self::assertSame($response->getHeaderLine('content-type'), 'application/vnd.geo+json');
}
}
diff --git a/tests/app/Http/RequestHandlers/MapDataImportPageTest.php b/tests/app/Http/RequestHandlers/MapDataImportPageTest.php
index f2ef7a9085..ffa32e5763 100644
--- a/tests/app/Http/RequestHandlers/MapDataImportPageTest.php
+++ b/tests/app/Http/RequestHandlers/MapDataImportPageTest.php
@@ -41,6 +41,6 @@ class MapDataImportPageTest extends TestCase
$response = $handler->handle($request);
self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
- self::assertSame($response->getHeaderLine('Content-Type'), 'text/html; charset=UTF-8');
+ self::assertSame($response->getHeaderLine('content-type'), 'text/html; charset=UTF-8');
}
}
diff --git a/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php b/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php
index 9eadf7280f..44f2167588 100644
--- a/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php
+++ b/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php
@@ -39,8 +39,8 @@ class SiteLogsDownloadTest extends TestCase
$query1 = $this->createStub(Builder::class);
$query2 = $this->createStub(Builder::class);
- $rows1 = $this->createStub(Collection::class);
- $rows2 = $this->createStub(Collection::class);
+ $rows1 = $this->createStub(Collection::class);
+ $rows2 = $this->createStub(Collection::class);
$query1->method('orderBy')->willReturn($query2);
$query2->method('get')->willReturn($rows1);
$rows1->method('map')->willReturn($rows2);
@@ -52,6 +52,8 @@ class SiteLogsDownloadTest extends TestCase
$handler = new SiteLogsDownload($site_logs_service);
$response = $handler->handle($request);
- $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
+ static::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
+ static::assertSame('text/csv; charset=UTF-8', $response->getHeaderLine('content-type'));
+ static::assertSame('attachment; filename="webtrees-logs.csv"', $response->getHeaderLine('content-disposition'));
}
}