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

25 lines
650 B
PHP
Raw Normal View History

2009-07-20 05:51:36 +00:00
<?php
2015-09-20 21:40:04 +00:00
class LinkImageTest extends ShimmiePHPUnitTestCase {
2009-07-20 05:51:36 +00:00
function testLinkImage() {
$this->log_in_as_user();
2015-08-09 11:14:28 +00:00
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pie");
2009-07-20 05:51:36 +00:00
2015-09-20 21:40:04 +00:00
# FIXME
2009-07-20 05:51:36 +00:00
# look in the "plain text link to post" box, follow the link
# in there, see if it takes us to the right page
2015-09-20 21:40:04 +00:00
$this->get_page("post/view/$image_id");
$this->markTestIncomplete();
2015-09-20 21:40:04 +00:00
// FIXME
2009-07-20 06:31:41 +00:00
$matches = array();
preg_match("#value='(http://.*(/|%2F)post(/|%2F)view(/|%2F)[0-9]+)'#", $raw, $matches);
2009-07-20 05:51:36 +00:00
$this->assertTrue(count($matches) > 0);
2012-03-12 23:27:24 +00:00
if($matches) {
$this->get($matches[1]);
$this->assert_title("Image $image_id: pie");
}
2009-07-20 05:51:36 +00:00
}
}