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

32 lines
1 KiB
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class DanbooruApiTest extends ShimmiePHPUnitTestCase
{
public function testSearch()
{
$this->log_in_as_admin();
2012-03-11 14:28:29 +00:00
$image_id = $this->post_image("tests/bedroom_workshop.jpg", "data");
2012-03-11 14:28:29 +00:00
$this->get_page("api/danbooru/find_posts");
2023-11-11 21:49:12 +00:00
$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_posts", ["tags" => "*"]);
2012-03-11 14:28:29 +00:00
$this->get_page("api/danbooru/find_tags");
2023-11-11 21:49:12 +00:00
$this->get_page("api/danbooru/find_tags", ["id" => 1]);
$this->get_page("api/danbooru/find_tags", ["name" => "data"]);
2012-03-11 14:28:29 +00:00
2020-01-29 20:22:50 +00:00
$page = $this->get_page("api/danbooru/post/show/$image_id");
$this->assertEquals(302, $page->code);
2012-03-11 14:28:29 +00:00
$this->get_page("post/list/md5:17fc89f372ed3636e28bd25cc7f3bac1/1");
//$this->assert_title(new PatternExpectation("/^Image \d+: data/"));
//$this->click("Delete");
}
2012-03-11 14:28:29 +00:00
}