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

24 lines
882 B
PHP
Raw Normal View History

2012-03-10 09:52:52 +00:00
<?php
2015-08-09 11:14:28 +00:00
class ShimmieApiTest extends ShimmiePHPUnitTestCase {
2015-09-26 10:17:13 +00:00
public function testAPI() {
2012-03-10 09:52:52 +00:00
$this->log_in_as_user();
2015-08-09 11:14:28 +00:00
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
2012-03-10 09:52:52 +00:00
2015-08-09 11:14:28 +00:00
// FIXME: get_page should support GET params
2012-03-10 09:52:52 +00:00
$this->get_page("api/shimmie/get_tags");
$this->get_page("api/shimmie/get_tags/pb");
2015-08-09 11:14:28 +00:00
//$this->get_page("api/shimmie/get_tags?tag=pb");
2012-03-10 09:52:52 +00:00
$this->get_page("api/shimmie/get_image/$image_id");
2015-08-09 11:14:28 +00:00
//$this->get_page("api/shimmie/get_image?id=$image_id");
2012-03-10 09:52:52 +00:00
$this->get_page("api/shimmie/find_images");
$this->get_page("api/shimmie/find_images/pbx");
$this->get_page("api/shimmie/find_images/pbx/1");
$this->get_page("api/shimmie/get_user/demo");
2015-08-09 11:14:28 +00:00
//$this->get_page("api/shimmie/get_user?name=demo");
//$this->get_page("api/shimmie/get_user?id=2");
2012-03-10 09:52:52 +00:00
// FIXME: test unspecified / bad values
// FIXME: test that json is encoded properly
}
}