more test passing

This commit is contained in:
Shish 2020-10-27 22:19:26 +00:00
parent 08b9729c72
commit 338bbcdbcb
2 changed files with 4 additions and 3 deletions

View file

@ -357,8 +357,9 @@ class Image
');
} else {
$tags[] = 'id'. $gtlt . $this->id;
$tags[] = 'order:id_'. strtolower($dir);
$querylet = Image::build_search_querylet($tags);
$querylet->append_sql(' ORDER BY images.id '.$dir.' LIMIT 1');
$querylet->append_sql(' LIMIT 1');
$row = $database->get_row($querylet->sql, $querylet->variables);
}

View file

@ -43,10 +43,10 @@ class ViewImageTest extends ShimmiePHPUnitTestCase
// When searching, we skip the middle
$page = $this->get_page("post/prev/$image_id_1", ["search"=>"test"]);
$this->assertEquals("/test/post/view/$image_id_3", $page->redirect);
$this->assertEquals("/test/post/view/$image_id_3?#search=test", $page->redirect);
$page = $this->get_page("post/next/$image_id_3", ["search"=>"test"]);
$this->assertEquals("/test/post/view/$image_id_1", $page->redirect);
$this->assertEquals("/test/post/view/$image_id_1?#search=test", $page->redirect);
// Middle image: has next and prev
$page = $this->get_page("post/next/$image_id_2");