Skip to content

Commit

Permalink
Merge pull request #485 from creative-commoners/pulls/1/p81fix
Browse files Browse the repository at this point in the history
ENH Various fixes for PHP 8.1 compatibility
  • Loading branch information
GuySartorelli committed Apr 13, 2022
2 parents a850ecc + d8492ea commit bd71554
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/php/ProtectedFileControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ protected function assertResponseEquals($code, $body, HTTPResponse $response)
if ($code === 200) {
$this->assertFalse($response->isError());
$this->assertEquals($body, $response->getBody());
$this->assertEquals('text/plain', $response->getHeader('Content-Type'));
// finfo::file() in league/flysystem Local::getMimeType() will return a mimetype of
// 'text/plain' for test case pdfs in php7.4 + 8.0 , though in php8.1 it will
// return 'application/octet-stream' which is then converted to 'application/pdf'
// based on the file extension
$this->assertTrue(in_array($response->getHeader('Content-Type'), ['text/plain', 'application/pdf']));
} else {
$this->assertTrue($response->isError());
}
Expand Down

0 comments on commit bd71554

Please sign in to comment.