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/post_owner/test.php
Shish db0e788a67 [core] Deduplicate ImageAdditionEvent & ImageInfoSetEvent
Rather than ImageAddition triggering TagsSet/SourceSet/LockSet etc in one way, and ImageInfoSet triggering TagsSet/SourceSet/LockSet in a different way, why not have ImageAddition *just* deal with image addition, and then send a separate ImageInfoSet to deal with all of the metadata setting?
2024-02-20 22:15:24 +00:00

22 lines
565 B
PHP

<?php
declare(strict_types=1);
namespace Shimmie2;
class PostOwnerTest extends ShimmiePHPUnitTestCase
{
public function testOwnerEdit(): void
{
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
$image = Image::by_id_ex($image_id);
$this->log_in_as_admin();
send_event(new ImageInfoSetEvent($image, 0, ["owner" => self::$admin_name]));
$this->log_in_as_user();
$this->get_page("post/view/$image_id");
$this->assert_text(self::$admin_name);
}
}