db0e788a67
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?
21 lines
583 B
PHP
21 lines
583 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shimmie2;
|
|
|
|
class PostSourceTest extends ShimmiePHPUnitTestCase
|
|
{
|
|
public function testSourceEdit(): void
|
|
{
|
|
$this->log_in_as_user();
|
|
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
|
|
$image = Image::by_id_ex($image_id);
|
|
|
|
send_event(new ImageInfoSetEvent($image, 0, ["source" => "example.com"]));
|
|
send_event(new ImageInfoSetEvent($image, 0, ["source" => "http://example.com"]));
|
|
|
|
$this->get_page("post/view/$image_id");
|
|
$this->assert_text("example.com");
|
|
}
|
|
}
|