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

31 lines
1 KiB
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
class ShimmieApiTest extends ShimmiePHPUnitTestCase
{
public function testAPI()
{
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
2012-03-10 09:52:52 +00:00
// FIXME: get_page should support GET params
$this->get_page("api/shimmie/get_tags");
$this->get_page("api/shimmie/get_tags/pb");
//$this->get_page("api/shimmie/get_tags?tag=pb");
$this->get_page("api/shimmie/get_image/$image_id");
//$this->get_page("api/shimmie/get_image?id=$image_id");
$this->get_page("api/shimmie/find_images");
$this->get_page("api/shimmie/find_images/pbx");
$this->get_page("api/shimmie/find_images/pbx/1");
2020-01-29 20:22:50 +00:00
$page = $this->get_page("api/shimmie/get_user/demo");
$this->assertEquals(200, $page->code);
//$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
}
2012-03-10 09:52:52 +00:00
}