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
2020-01-26 16:27:56 +00:00

25 lines
800 B
PHP

<?php declare(strict_types=1);
class LinkImageTest extends ShimmiePHPUnitTestCase
{
public function testLinkImage()
{
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pie");
# FIXME
# look in the "plain text link to post" box, follow the link
# in there, see if it takes us to the right page
$this->get_page("post/view/$image_id");
$this->markTestIncomplete();
// FIXME
$matches = [];
preg_match("#value='(http://.*(/|%2F)post(/|%2F)view(/|%2F)[0-9]+)'#", $this->page_to_text(), $matches);
$this->assertTrue(count($matches) > 0);
if ($matches) {
$this->get($matches[1]);
$this->assert_title("Image $image_id: pie");
}
}
}