cavepaintingsFork/ext/danbooru_api/test.php
2020-01-29 20:22:50 +00:00

26 lines
927 B
PHP

<?php declare(strict_types=1);
class DanbooruApiTest extends ShimmiePHPUnitTestCase
{
public function testSearch()
{
$this->log_in_as_admin();
$image_id = $this->post_image("tests/bedroom_workshop.jpg", "data");
$this->get_page("api/danbooru/find_posts");
$this->get_page("api/danbooru/find_posts?id=$image_id");
$this->get_page("api/danbooru/find_posts?md5=17fc89f372ed3636e28bd25cc7f3bac1");
$this->get_page("api/danbooru/find_tags");
$this->get_page("api/danbooru/find_tags?id=1");
$this->get_page("api/danbooru/find_tags?name=data");
$page = $this->get_page("api/danbooru/post/show/$image_id");
$this->assertEquals(302, $page->code);
$this->get_page("post/list/md5:17fc89f372ed3636e28bd25cc7f3bac1/1");
//$this->assert_title(new PatternExpectation("/^Image \d+: data/"));
//$this->click("Delete");
}
}