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/link_image/test.php

22 lines
592 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class LinkImageTest extends ShimmiePHPUnitTestCase
{
2024-01-15 14:31:51 +00:00
public function testLinkImage(): void
{
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pie");
$this->get_page("post/view/$image_id");
2015-09-20 21:40:04 +00:00
$matches = [];
preg_match("#value='https?://.*/(post/view/[0-9]+)'#", $this->page_to_text(), $matches);
2023-01-11 11:15:26 +00:00
$this->assertNotEmpty($matches);
$page = $this->get_page($matches[1]);
2020-10-26 15:16:45 +00:00
$this->assertEquals("Post $image_id: pie", $page->title);
}
2009-07-20 05:51:36 +00:00
}