From 752597385e74251660b69a3cbc68530944209ec4 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 11 Mar 2012 14:28:29 +0000 Subject: [PATCH] start of danbooru API tests --- contrib/danbooru_api/test.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 contrib/danbooru_api/test.php diff --git a/contrib/danbooru_api/test.php b/contrib/danbooru_api/test.php new file mode 100644 index 00000000..bbc4c2d6 --- /dev/null +++ b/contrib/danbooru_api/test.php @@ -0,0 +1,26 @@ +log_in_as_admin(); + + $image_id = $this->post_image("ext/simpletest/data/bedroom_workshop.jpg", "data"); + + $this->get_page("post/list/md5:17fc89f372ed3636e28bd25cc7f3bac1/1"); + $this->assert_title(new PatternExpectation("/^Image \d+: data/")); + $this->click("Delete"); + + $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"); + + $this->get_page("api/danbooru/post/show/$image_id"); + $this->assert_response(302); + + $this->log_out(); + } +} +?>