[handle_archive] add tests

This commit is contained in:
Shish 2024-01-04 16:45:29 +00:00
parent ff04083ad5
commit fd403c2b84

View file

@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace Shimmie2;
class ArchiveFileHandlerTest extends ShimmiePHPUnitTestCase
{
public function testArchiveHander()
{
$this->log_in_as_user();
system("zip -q tests/test.zip tests/pbx_screenshot.jpg tests/favicon.png");
$this->post_image("tests/test.zip", "a z");
$images = Search::find_images();
$this->assertEquals(2, count($images));
$this->assertEquals("a tests z", $images[0]->get_tag_list());
$this->assertEquals("a tests z", $images[1]->get_tag_list());
}
public function tearDown(): void
{
if(file_exists("tests/test.zip")) {
unlink("tests/test.zip");
}
}
}