This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/image/test.php

37 lines
1.1 KiB
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class ImageIOTest extends ShimmiePHPUnitTestCase
{
2024-01-15 14:31:51 +00:00
public function testUserStats(): void
{
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");
// broken with sqlite?
//$this->get_page("user/test");
//$this->assert_text("Images uploaded: 1");
2010-03-12 18:48:30 +00:00
//$this->click("Images uploaded");
//$this->assert_title("Image $image_id: test");
# test that serving manually doesn't cause errors
2020-01-29 20:22:50 +00:00
$page = $this->get_page("image/$image_id/moo.jpg");
$this->assertEquals(200, $page->code);
$page = $this->get_page("thumb/$image_id/moo.jpg");
$this->assertEquals(200, $page->code);
}
2020-04-24 13:10:45 +00:00
2024-01-15 14:31:51 +00:00
public function testDeleteRequest(): void
2020-04-24 13:10:45 +00:00
{
$this->log_in_as_admin();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");
2024-02-09 16:36:57 +00:00
send_event(new PageRequestEvent("POST", "image/delete", [], ['image_id' => "$image_id"]));
2020-04-24 13:10:45 +00:00
$this->assertTrue(true); // FIXME: assert image was deleted?
}
}