Fix gzopen and user creation issues

This commit is contained in:
DariusIII
2026-04-26 11:38:57 +02:00
parent 303391ef6d
commit 477364d40b
4 changed files with 256 additions and 10 deletions
@@ -8,6 +8,20 @@ use Tests\TestCase;
class HelperCoverUrlTest extends TestCase
{
public function test_unzip_gzip_file_returns_uncompressed_contents(): void
{
$path = tempnam(sys_get_temp_dir(), 'nntmux-gzip-');
$this->assertIsString($path);
file_put_contents($path, gzencode('gzip fixture contents'));
try {
$this->assertSame('gzip fixture contents', unzipGzipFile($path));
} finally {
@unlink($path);
}
}
public function test_get_release_cover_returns_placeholder_for_negative_bookinfo_id(): void
{
$url = getReleaseCover((object) ['bookinfo_id' => -2]);